Welcome to the Monastery | |
PerlMonks |
Re^5: Sub hash param by referenceby Athanasius (Archbishop) |
on Jul 10, 2016 at 08:44 UTC ( [id://1167516]=note: print w/replies, xml ) | Need Help?? |
Hello hankcoder, I'm not quite understand what is $_[0] The special variable @_1 is documented as follows: Within a subroutine the array @_ contains the parameters passed to that subroutine. Inside a subroutine, @_ is the default array for the array operators pop and shift. Now, in Perl2 you access the individual elements of array @my_array as $my_array[0], $my_array[1], $my_array[2], .... (Note that the first element has index zero.) In the same way, the array @_ (which is named “ _ ”) has elements $_[0], $_[1], $_[2], .... So $_[0] is the first parameter passed to the subroutine.
1You can also call it @ARG if you use English; — see perlvar#General-Variables. Hope that helps,
In Section
Seekers of Perl Wisdom
|
|