Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

what do you call this data structure?

by Anonymous Monk
on Aug 27, 2013 at 18:54 UTC ( #1051183=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

my $c = { 'even' => [2,4,6,8], 'odd' => [1,3,5,7] };

Comment on what do you call this data structure?
Download Code
Re: what do you call this data structure?
by toolic (Chancellor) on Aug 27, 2013 at 19:00 UTC
    $c is a reference to a hash of arrays. Refer to perldsc.
      thank you
Re: what do you call this data structure?
by Anonymous Monk on Aug 27, 2013 at 21:29 UTC

    To use slightly-more Perlspeak:   “$c is a hashref that refers to a hash containing two keys, even and odd, both of which are arrayrefs that refer to a separate arrays of 4 integers.”

      hashkey can't be arrayrefs, they're hashkeys, they're strings
Re: what do you call this data structure?
by sundialsvc4 (Abbot) on Aug 28, 2013 at 02:00 UTC

    (The original post here was mine ... PM logged me out.)   My intended meaning was that “the values associated with {each key within the hash} are {arrayrefs} ... etc.”   (Braces added for clarity.)

    But here again, heh..., is potential ambiguity to those who, so to speak, “do not (yet...) speak the language.”   Thanks for the clarification.

Re: what do you call this data structure?
by hdb (Prior) on Aug 28, 2013 at 05:28 UTC

    I call it incomplete. Where are zero and nine?



      Not necessarily. Let's give the OP the benefit of the doubt and assume that the names make sense in context. (e.g. He is working with eight objects.)
      Bill

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1051183]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-11-28 07:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (193 votes), past polls