Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Wrong idioms

by Jenda (Abbot)
on Apr 01, 2013 at 18:39 UTC ( #1026529=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Wrong idioms
in thread Wrong idioms

Don't call then! All advice you ever hear about changes to these variables says "change them only in the smallest possible scope and do not call anything that might expect them to be set to the normal values".

Most of the variables are not changed too often so I would not sweat about it. The only one I see changed is $/ and the code usually looks like this:

my $contents = do {local $/; <HANDLE>;}
or
my $contents; { local $/; $contents = <HANDLE>; }

and the code implementing readline() for handles is the only one I would expect to check the value of $/.

Jenda
Enoch was right!
Enjoy the last years of Rome.


Comment on Re^4: Wrong idioms
Select or Download Code
Re^5: Wrong idioms
by moritz (Cardinal) on Apr 01, 2013 at 19:21 UTC

Log In?
Username:
Password:

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

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

    How do you remember the number of days in each month?











    Results (140 votes), past polls