mow14 has asked for the wisdom of the Perl Monks concerning the following question:
I'm pretty new to perl and have hit a wall with a script i am trying to write. I want to add two potential values for each key in a hash. I am attempting to do it as below but i'm not sure if it is correct
I am also then trying to read each value by executing something like$uniq{"$file"} = ({"suffix1"=>"$suff"}); $uniq{"$file"} = ({"suffix2"=>"$suff"});
Is this correct..or even possible??foreach my $key (sort keys %uniq){ if ((exists($uniq{$key}{suffix1}) && ($uniq{$key}{suffix2}))){ .....
Cheers!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Multiple values per key in a hash
by moritz (Cardinal) on May 13, 2008 at 10:06 UTC | |
Re: Multiple values per key in a hash
by TOD (Friar) on May 13, 2008 at 10:09 UTC | |
Re: Multiple values per key in a hash
by sasdrtx (Friar) on May 13, 2008 at 11:11 UTC | |
Re: Multiple values per key in a hash
by mhearse (Chaplain) on May 13, 2008 at 10:53 UTC | |
Re: Multiple values per key in a hash
by linuxer (Curate) on May 13, 2008 at 10:34 UTC | |
Re: Multiple values per key in a hash
by Pancho (Pilgrim) on May 13, 2008 at 12:55 UTC |