in reply to Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> };
Maybe I'm missing something. Besides basic coolness, and getting it down to one line, I don't understand the specific advantage of using "do" as opposed to how I usually slurp:
Cheers,
s-t
That said, I do like the way the proposed idiom looks.my $string; { local $/ = undef; $string = <FH>; }
Cheers,
s-t
|
---|
In Section
Meditations