Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Object to Map Multiple Values to a Single Key

by Abigail-II (Bishop)
on May 27, 2003 at 12:30 UTC ( [id://260975]=note: print w/replies, xml ) Need Help??


in reply to Object to Map Multiple Values to a Single Key

This object provides a simple front to a hash mapping keys to arrays of values thus allowing multiple values for a single key.

But it uses on OO interface, and hence you are missing out on all of the goodies hashes have to offer. No slices, no keys, no values, no each.

You are just offering a trivial object to store keys with many values in, not a replacement for hashes.

Abigail

  • Comment on Re: Object to Map Multiple Values to a Single Key

Replies are listed 'Best First'.
Re: Re: Object to Map Multiple Values to a Single Key
by l2kashe (Deacon) on May 27, 2003 at 15:12 UTC
    Personally I concur with both Abigail-II and jeffa. They have already talked about what they think is not quite right, and I'll add a bit more.

    Not only do we lose yummy hash goodness, but everytime we go to add data via this methodology, or remove data we are copying the entire array contents, allocate more memory, etc.... Granted on smaller data sets this might be trivial, but when the data sets get larger, and the hash structure gets sparser, this will lead to serious performance degredation.

    I have had issues with some of Abigail-II's comments in the past as well, but 9 times out of 10 they are spot on technically, and it's just my ego getting in the way of me learning something new. I think that the whole point of the comments here were really just an attempt to show you that this particular wheel, isn't really a wheel and attempting to reinvent it may lead you to BadPlaces(TM). I would personally be interested to hear/read why you needed this abstraction.

    No offense against your skill level coding, but this smacks of a learning process, looking back over my own personal experience. It feels like you may be making this abstraction to get around some other issue. More of a band-aid as opposed to a diagnosis and treatment. What can you use this as a base for that you couldn't with a normal hash or hash ref? Why a hash instead of an array, with elements you need being assigned numerical values? What problem space are you addressing?

    One last thing. Personally I feel like you turned around and did to Abigail-II exactly what you claimed (he/she?) did to you. Personally I think the right thing to do would be to apologize to (him/her?), even if it isn't public as your comments came across as off the cuff, scathing, and down right immature..

    Note: I'm simply asking you to look at the mirror, not attempting to start a flame war.

    MMMMM... Chocolaty Perl Goodness.....
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2024-04-18 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found