Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Differ. array and List

by gopalr (Priest)
on Apr 26, 2005 at 04:25 UTC ( #451423=note: print w/replies, xml ) Need Help??


in reply to Differ. array and List

A list is an ordered collection of scalars. An array is a variable that contains a list. The two terms are often used as if they're interchangeable. But, to be accurate, the list is the data, and the array is the variable. You can have a list value that isn't in an array, but every array variable holds a list (although that list may be empty).

List Assignment

($fred, $barney, $dino) = ("flintstone", "rubble", undef); ($fred, $barney) = ($barney, $fred);

Array Assignment

@rocks = qw/ bedrock slate lava /; @tiny = ( ); # the empty list $dino = "granite"; @quarry = (@rocks, "crushed rock", @tiny, $dino);

Log In?
Username:
Password:

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

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