Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by YenForYang (Beadle)
on May 16, 2018 at 05:27 UTC ( #1214608=note: print w/replies, xml ) Need Help??


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

Awesome, thanks for the explanation.

What do you mean though by

Note that this aliases $_ to the scalar, but File::Find does not take advantage of that feature.
Specifically the part about not taking advantage of the feature. What features could be taken advantage of? Thanks

EDIT:

Oh wait are you saying that $a could be used like $_ (they become equivalent?). Or is there something else?

Replies are listed 'Best First'.
Re^3: What is the purpose of local *_ = \my $a in File::Find?
by ikegami (Pope) on May 17, 2018 at 00:54 UTC
    $ perl -E'local *_ = \my $s; $_ = 123; say $s; $s = 456; say $_;' 123 456

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2018-11-13 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (149 votes). Check out past polls.

    Notices?