@_ holds the values of parameters passed to the sub when it is called from
the code
 when it is used like that in subs

It has different meanings in different places
it is called default input variable


----- Original Message -----
From: "David Buddrige" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 05, 2002 2:53 PM
Subject: Understanding list creation...


> Hi all,
>
> I am reading through a collegue's perl script.  In it he has the
> following lines:
>
>
> sub SomeSubName
> {
> my ($vara, $varb, $varc, @items) = @_;
> my ($itemtype, %symbol);
> ...
> }
>
> The first line I understand; here you are getting the parameters to the
> subroutine (which are stored in @_), and putting them into particular
> variable names - $vara, $varb, and so on.
>
> The second line however, I am not clear what it is doing.
>
> It seems to be creating an in-line list, but firstly, that list is not
> assigned to anything, and secondly he is storing a hash into the list
> (presumably it must be a reference to a hash, since you cannot actually
> store a hash into a data structure such as a list or an array without
> using refernces...
>
> Could anyone see what possible value could be had in creating the list:
>
> my ($itemtype, %symbol);
>
> Is this assigned to some default name?
>
> thanks heaps
>
> David Buddrige.
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to