Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: What is the purpose of local *_ = \my $a in File::Find?

by ikegami (Patriarch)
on May 11, 2018 at 20:18 UTC ( [id://1214403]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -wE'for ($|) { local $_; $_ = "abc"; say; }'
    Argument "abc" isn't numeric in scalar assignment at -e line 1.
    0
    
  2. or download this
    $ perl -E'$_="x"; @_=(4,5); say $_,@_; local *_; say $_,@_;'
    x45
    
  3. or download this
    $ perl -E'$_="x"; @_=(4,5); say $_,@_; local *_ = \my $a; say $_,@_;'
    x45
    45
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-26 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found