This is something I'd probably use Set::Scalar for. It does all the set stuff for you.
$hash{g1} = Set::Scalar->new(qw(ATG1 ATG2 ATG4 ATRG7)); $hash{g2} = Set::Scalar->new(qw(ATG1 x y z)); if( $hash{g1}->intersection($hash{g2}) ) { print "merging g1 and g2\n"; $hash{g1}->insert(delete $hash{g2}) }
Not sure if that really answers the question though.
-Paul
In reply to Re: Should I use a hash for this?
by jettero
in thread Should I use a hash for this?
by awos22
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |