Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: alpha vs alpha numeric

by malaga (Pilgrim)
on Jun 12, 2002 at 11:27 UTC ( #173775=note: print w/replies, xml ) Need Help??


in reply to alpha vs alpha numeric

Yes, i'm checking for an exact match. i tried with Q, no difference. there aren't any characters besides alpha and numeric. Thanks again.

Replies are listed 'Best First'.
Re: Re: alpha vs alpha numeric
by strat (Canon) on Jun 13, 2002 at 11:40 UTC
    Maybe you could split up the line into two statements to find the problem easier:
    if ($ref->{prodname} =~ /$value/) { # worked } elsif($ref->{key1} =~ /\Q$value\E/) { # worked }
    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.

    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"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://173775]
help
Chatterbox?
and the monastery is silent...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2017-10-22 21:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (275 votes). Check out past polls.

    Notices?