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 reply to Re: Re: Re: Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> };
by chromatic
in thread Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> };
by jeffa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |