Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

by chromatic (Archbishop)
on Sep 02, 2003 at 21:25 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-29 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found