in reply to Re: alpha vs alpha numeric
in thread alpha vs alpha numeric
For the next step, try to replace /\Q$value\E/ with /^\Q$value\E$/<P> If it still works, the only possibility that comes into my mind are newlines (e.g. if you read something from a file or STDIN) in either $ref->{...} or $value. You can remove them with chomp( $ref->{...} ) or the like.if ($ref->{prodname} =~ /$value/) { # worked } elsif($ref->{key1} =~ /\Q$value\E/) { # worked }
Then, $ref->{...} eq $value might work as well.
If you need case insensitive comparisons, try
$ref->{...} =~ /^\Q$value\E/i, or in the next step:
if (lc ( $ref->{...} ) eq lc($value) ) {
Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"
|
|---|