Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 browsing the Monastery: (13)
As of 2015-07-08 07:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (96 votes), past polls