Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by VSarkiss (Monsignor)
on Aug 29, 2003 at 15:25 UTC ( #287706=note: print w/ replies, xml ) Need Help??


in reply to Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> };

One of the best explanations I've heard for $/ is due to TheDamian1:

$/ tells Perl when to stop reading.
So, when $/ has its default value of newline, Perl stops reading when it sees the newline character. When it's not defined, Perl doesn't stop reading until the end of the stream.

1I'm pretty sure of the source, but not 100%. If you have a correction, please let me know.


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2014-08-30 19:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls