Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

(tye)Re: localization of $_

by tye (Sage)
on Feb 28, 2001 at 00:40 UTC ( [id://61164]=note: print w/replies, xml ) Need Help??


in reply to Re: localization of $_
in thread localization of $_

...and you can also be defensive and protect yourself from other code that isn't as nice:

sub mine { local( $_ ); while( <FILE> ) { s/this/that/g; { local( $_ )= $_; yours( $_ ); } s/that/this/g; }
though if you find yourself doing that I strongly suggest you just switch to using my $var instead of $_.

        - tye (but my friends call me "Tye")

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found