Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Re: Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> };

by chromatic (Archbishop)
on Sep 02, 2003 at 21:25 UTC ( #288445=note: print w/ replies, xml ) Need Help??


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


Comment on Re: Re: Re: Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> };
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://288445]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (18)
As of 2014-07-28 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (208 votes), past polls