Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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] };

Replies are listed 'Best First'.
Re: what do you call this data structure?
by toolic (Bishop) 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 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
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.

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?
[Your Mother]: …how on Earth could Perl’s grep recurse?
[Tanktalus]: perldigious: I'm not looking to get rich. I'm looking for interesting work, with good continuity of employment, and maintenance of our current lifestyle. (An improvement wouldn't be bad, either, but that's not a requirement ;) )
erix enjoys the confusion++
[Your Mother]: :P
[Tanktalus]: Without confusion, I'd be out of a job ;)
[Tanktalus]: Already. :D
[Lady_Aleena]: Your Mother, I wish it did have a way to put in a directory to search.
[Your Mother]: That’s silly. It’s a string op tool.
[Lady_Aleena]: So I guess I'll go argue with File::Find and grep.
[Your Mother]: I would probably use Path::Tiny instead for it's slurp and such.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2017-05-23 19:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?