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

Re: Differ. array and List

by Fletch (Chancellor)
on Apr 26, 2005 at 01:53 UTC ( #451404=note: print w/replies, xml ) Need Help??


in reply to Differ. array and List

An array is an array, a list is a list.

An array is an ordered collection of values which lives in a permanent (more or less) location such as a named variable in the symbol table (e.g. $main::array or a named lexical (my @array = ( . . . )) (and yes, I'm ignoring references). A list is a temporary ordered set of values that lives on the call stack being put somewhere. An array in list context produces a list of the values it contains. An array can be used most places a LIST is expected, but not vice versa (for example push wants a literal array as its first argument).

It's a subtle distinction, but a few careful readings of perldata may eventually produce enlightenment.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2020-01-28 20:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?