On 8/25/06, Oliver Bandel <oliver / first.in-berlin.de> 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 }

iterates over LINES of files passes on commandline, not files.
try ARGV for filenames.

you can see the behaviour when you'll add
  puts "new file"
before while