Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Unconstructive Criticism

by adrianh (Chancellor)
on May 27, 2003 at 15:09 UTC ( [id://261011]=note: print w/replies, xml ) Need Help??


in reply to A Quote
in thread Object to Map Multiple Values to a Single Key

The object was never meant to be a replacement for hashes

That was (as I read it) Abigail's point. You're not providing a front end to a hash, you're providing an easy way of doing key -> arrayref mappings. You're dealing with a hashref not a hash. Hence your module description could be better expressed.

I think you read way to much into Abigail's post. Abigail's (usually pretty darn accurate) comments may be blunt, but the bluntness is always aimed at code, not people.

Unlike your message, which I --'d since I find it too close to a personal attack for my tastes.

The object is trivial. Nothing wrong with that in itself. However we have an expressive syntax in Perl already for this sort of thing.

my %map; push @{$map{K1}}, 'V1'; push @{$map{K1}}, 'V2'; push @{$map{K2}}, 'V3'; push @{$map{K3}}, 'V4'; print Dumper(\%map); # or my %map2; $map2{K1} = ['V1', 'V2']; $map2{K2} = ['V3']; $map2{K3} = ['V4']; print Dumper(\%map2); # or my %map3; @map3{'K1','K2','K3'} = (['V1', 'V2'], ['V3'], ['V4']); print Dumper(\%map3); # etc.

So, for me, it doesn't really supply anything that Perl doesn't give us already for free.

On a stylistic note I would use add_value() (or similar) rather than put() since the latter sounds like it should be the inverse of get() and it isn't.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-24 10:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found