Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Accessing Arguments inside Subroutines via @_

by ikegami (Patriarch)
on Mar 23, 2015 at 01:54 UTC ( [id://1120928]=note: print w/replies, xml ) Need Help??


in reply to Accessing Arguments inside Subroutines via @_

@_ = ( $item[0], $item[1] );
is effectively
@_ = (); push @_, $item[0], $item[1];
You're not assigning to the alias but replacing them with new scalars. To assign to the aliases, you'll have to list the elements or use an array slice.
( $_[0], $_[1] ) = ...;
or
@_[0..$#_] = ...;

Log In?
Username:
Password:

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

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

    No recent polls found