Oliver Bandel wrote:
> Hello,
>
>
> The Code:
>
> ====================================
> def look_for_begin
>    while line = gets
>      if line =~ /^begin/
>        puts line
>        # return
>      end
>    end
> end
>
> ARGF.each { look_for_begin }
> ====================================
>
> I have files with uuencoded and yencoded
> data, and some text-only files, all in all 188 files,
> and the size for all are about 16 MB.

If you have enough RAM to slurp whole files:

while text = gets( nil )
  # text contains the entire contents of one file.
  if text =~ /^begin.*/
    puts "In #{ $FILENAME }, found:"
    puts $&
  end
end