[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] pop (keys %hash) ?



On Fri, 18 Jun 1999 15:33:25 -0400, Shawn O'Donnell wrote:

>Interesting, but I'm confused by the documentation.  perlfunc says
>
>     keys HASH
>
>         Returns a normal array consisting of all the keys of the
>         named hash.

Does it say "array"? My Mac is switched off, so I can't check, but
perlfunc on my PC (v. 5.005) clearly says:

    keys HASH
            Returns a list consisting of all the keys of the named
            hash.

A list is not an array.

>Is a "normal array" different than "array"?  pop wants an array.

Hmm... how can I put this... It's like you were to try

	"Greeting" = "Hello world";

You cannot replace the literal "Greeting" because it's not an lvalue (=
left side value, i.e. an lvalue can be on left side in an assignment:
you can change it). In the same manner, you cannot change a list, well,
because it isn't an array. 

An array is bound to an array variable, or an array ref: you can change
the contents of the variable. But a list is NOT bound to a variable:
it's just a pile of scalar values.

I hope this makes sense.

	Bart.

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org