From: intc_ctor@... (Phil Tomson) Date: 2004-01-27T02:59:54+09:00 Subject: Re: Regurgitating the contents of a file Philip Mak wrote in message news:<20040125230811.GG5772@lina.aaanime.net>... > What's the shortest way to regurgitate the contents of a file? I mean > like this: > > # Perl code > open(FILE, "filename.txt"); > print while ; > close(FILE); > > Can I do something like: > > stdout << File.new("filename.txt"); > > or something? File.foreach("filename.txt") {|line| puts line } Or if you prefer: File.foreach("filename.txt") {|line| $stdout << line } Phil