in reply to Re: getfile( $filename )
in thread getfile( $filename )
Yeah, I've run across that little ditty before, most recently as a yak shaving on my IPC::Open3 journey, but it doesn't handle wantarray. It just occurred to me that it doesn't chomp the lines either ... hmmm ...
I wish there was a way to chomp <$FH>.return wantarray ? do { my @lines = <$FH> ; chomp @lines ; @lines } : do { local $/ ; <$FH> };
Harley J Pig
In Section
Cool Uses for Perl