in reply to Re: Re: Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> };
in thread Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> };
Your first suggestion would seem to double the input record separator. Did you test it? Do you somehow have autochomp enabled?
#!/usr/bin/perl -w use strict; my $line = join $/, <DATA>; print "<<$line>>\n"; __DATA__ one two tie my shoe
|
---|
In Section
Meditations