Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Differ. array and List

by gopalr (Priest)
on Apr 26, 2005 at 04:25 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://451423]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-25 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found