|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re: passing arrays to subroutinesby BazB (Priest) |
| on Mar 16, 2005 at 13:11 UTC ( #439930=note: print w/ replies, xml ) | Need Help?? |
|
A subroutine gets it's arguments as an array (@_), so if you do Within some_sub, @_ will equal the contents of @array. However, you probably want to pass the array into the subroutine by reference (see perlref for more): In that case, the first element of @_, the argument list to some_sub, will be a reference to @array. If the information in this post is inaccurate, or just plain wrong, don't just downvote - please post explaining what's wrong.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||