Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Modern Perl: The Book: The Draft

by morgon (Deacon)
on Jul 25, 2010 at 09:31 UTC ( #851246=note: print w/ replies, xml ) Need Help??


in reply to Modern Perl: The Book: The Draft

Just a tiny thing (or maybe just a matter of taste):

In Chapter 10 "Easy File Slurping", you use this idiom for slurping:

my $file = do { local $/ = <$fh> };

For me the assignment to the localized $/ (that is done just so that the do-block returns the file-content) is confusing.

Clearer (for me):

my $file = do { local $/; <$fh> };


Comment on Re: Modern Perl: The Book: The Draft
Select or Download Code
Replies are listed 'Best First'.
Re^2: Modern Perl: The Book: The Draft
by chromatic (Archbishop) on Jul 25, 2010 at 21:42 UTC

    I've seen both idioms, so both deserve an explanation. Thanks for the suggestion; how would you like me to credit you?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2015-08-05 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (81 votes), past polls