Hi I have the following code my $type='val'; my $type_g; foreach my $key (keys %options){ my $chk=$options{$key}->[3]; $type_g=$options{$key}->[4] if $chk=~/$type/; #$type_g=$options{$key}->[4] if $type=~/$chk/; } print "\n",$type,"\t",$type_g,"\n";
This fails but if I replace $type_g=$options{$key}->[4] if $chk=~/$type/ with either $type_g=$options{$key}->[4] if $type=~/$chk/; (ie:reversing the match) or $type_g=$options{$key}->[4] if $type eq $chk; any idea on the reasons for this behaviour -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/