Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Accessing Arguments inside Subroutines via @_

by LanX (Saint)
on Mar 21, 2015 at 17:10 UTC ( [id://1120844]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Accessing Arguments inside Subroutines via @_
in thread Accessing Arguments inside Subroutines via @_

I just wanted to highlight why it makes sense that assigning to @_ doesn't write thru to the aliases.

my and local were already mentioned in my footnote, when using typeglobs I'd strongly suggest to prefer *b = \$a; over  *b = *a;

But these mechanisms are no big help if you want named parameters in subs cause those are lexicals, (which should be the preferred variable flavor).

> I'd not be surprised at all if there were CPAN modules that implemented this.

see Data::Alias or Lexical::Alias and their discussion in PBP

Perl6 aims to handle aliasing consistently.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)

PS: Je suis Charlie!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-28 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found