Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: data structures

by perlfan (Curate)
on Nov 27, 2007 at 19:39 UTC ( #653349=note: print w/ replies, xml ) Need Help??


in reply to data structures

Scalar:

my $scalar = 'abc'; print "$scalar\n";
Array:
my @array = ('abc', 123, 'dog'); for (@array) { print "$_\n"; }
Hash (aka, associative array):
my %hash = ( bob => 'dog', sue => 'cat', jim => 'parrot',); for (keys(%hash)) { print "$_ has a $hash{$_}.\n"; }
There are others, but I think if I mention them your head will explode. Master these, then start thinking about combining them into complex data structures such as arrays of arrays, hashes of hashes, etc.

Also, don't post questions just for XP - if you don't have thoughtful questions to ask, then you're gonna get down modded like you have been. I've tried to tell you this in private chat, but apparently you don't understand what I am meaning.


Comment on Re: data structures
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-12-20 05:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls