Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: passing arrays to subroutines

by nobull (Friar)
on Mar 16, 2005 at 21:02 UTC ( #440147=note: print w/ replies, xml ) Need Help??


in reply to Re: passing arrays to subroutines
in thread passing arrays to subroutines

my $a=@_[0];

Unpacking @_ with explicit subscripts is inefficient and unsightly. Using an array slice in a scalar context is also messy.

my ($a)=@_;
or
my $a=shift;


Comment on Re^2: passing arrays to subroutines
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (17)
As of 2015-07-06 17:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (77 votes), past polls