Chas Owens wrote:
On 3/8/06, Eugeny Altshuler <[EMAIL PROTECTED]> wrote:
snip
local $/; # to slurp the file at once
my $joined=<>;
...
Be careful with the setting of $/. In small scripts like this one it
is not very dangerous, but in larger scripts in can cause all manner
of bugs if not properly localized:
my $joined;
{
local $/ = undef;
$joined = <>;
}
I like to write this like:
my $joined = do { local $/; <> };
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>