А грепнуть по pcre-выражению? $ grep -P '^\s*while' lib/*.pm grep: The -P option is not supported $ [[:space:]] не предлагать... :)