http://www.perlmonks.org?node_id=1035215


in reply to Re^5: Possible for Map to create Hash of Hash?
in thread Possible for Map to create Hash of Hash?

> If the OP doesn't need it, then no need to do it that way. We have no way of knowing if that's what the OP needs, maybe they don't know about the other solution.

Well the OP explicitly asked for HoHs and said " To create a hash that will allow me to determine if a store has a product I can use: "

I'm no native speaker, but for me this also reads like "if a store has products at all" which is quite complicated with a flat multi-dim hash.

I'm not banning multi-dim hashes both approaches have pro and cons.

Cheers Rolf

( addicted to the Perl Programming Language)

  • Comment on Re^6: Possible for Map to create Hash of Hash?

Replies are listed 'Best First'.
Re^7: Possible for Map to create Hash of Hash?
by runrig (Abbot) on May 25, 2013 at 14:29 UTC
    Well the OP explicitly asked for HoHs and said " To create a hash that will allow me to determine if a store has a product I can use: "

    I'm no native speaker, but for me this also reads like "if a store has products at all" which is quite complicated with a flat multi-dim hash.

    To me it sounds like he just needs a store/product lookup and assumes that he needs an explicit HoH...but it is somewhat ambiguous, and things around here are not always clearly written, so let's just throw both solutions out there and let'em pick.