in reply to Having multiple values for a Hash key

Use a hash within a hash
my %table = ( optimal => 'good', failed => {missing => 1, bad => 1}, ); print $table{failed}{missing};
Or an array within the hash
my %table = ( optimal => 'good', failed => [qw(missing bad)], ); print (grep {$_ eq 'missing'} @{$table{failed}}) ? 'missing' : 'ok';

Replies are listed 'Best First'.
Re^2: Having multiple values for a Hash key
by justkar4u (Novice) on May 02, 2011 at 17:17 UTC
    Hi , Thanks everyone for the reply.. I am using the solution suggested by wind since it matches closely with what i need to implement ! Thank you again for the replies.