Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2018-07-22 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (451 votes). Check out past polls.

    Notices?