Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: why use a hash instead of an array

by karlgoethebier (Curate)
on Jun 11, 2013 at 19:20 UTC ( #1038331=note: print w/ replies, xml ) Need Help??


in reply to why use a hash instead of an array

It's just about how you want/like/need your data:

#!/usr/bin/env perl + use strict; use warnings; use Data::Dumper; my $karl; $karl->{nose} = qq(cuke); $karl->{monk} = 1; $karl->{axes} = ["Strat", "Ibanez"]; $karl->{pets} = ["Dog", "Fishes"]; $karl->{skills} = ["C", "Perl", "Ecma", "NULL"]; print Dumper($karl); __END__ Karls-Mac-mini:monks karl$ ./karl.pl + $VAR1 = { + 'skills' => [ + 'C', + 'Perl', + 'Ecma', + 'NULL' + ], + 'pets' => [ + 'Dog', + 'Fishes' + ], + 'nose' => 'cuke', + 'monk' => 1, + 'axes' => [ + 'Strat', + 'Ibanez' + ] + };

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»


Comment on Re: why use a hash instead of an array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2014-07-28 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (204 votes), past polls