There's more than one way to do things | |
PerlMonks |
Re: can i concatenate various value to form a unique keyby Marshall (Canon) |
on Jul 03, 2009 at 09:26 UTC ( [id://776996]=note: print w/replies, xml ) | Need Help?? |
It is completely fine to make a hash key from other strings. like:
Update: I would argue that this is not the best way: my $key = join ("",$value1,$value2,$value3,$value4,$value5); consider: my $key ="$value1$value2$value3$value4$value5"; if say $value3 doesn't exist, then, $key = "$value1$value2$value4$value5"; Oooops!...maybe a problem!!!
$hash{"$value1;$value2;$value3;$value4;$value5"} = 123;
In Section
Seekers of Perl Wisdom
|
|