Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: alpha vs alpha numeric

by perigeeV (Hermit)
on Jun 12, 2002 at 11:13 UTC ( #173767=note: print w/replies, xml ) Need Help??


in reply to alpha vs alpha numeric

I don't know what you're comparing with the regex, but you do have to include the preceding "m" in a regex when you chose to use delimiters different than the default slashes, eg.:

if (($ref->{prodname} =~ m($value)) || ($ref->{key1} =~ m($value)))

You may also consider testing with eq if you want everything stringified.


Replies are listed 'Best First'.
Re: alpha vs alpha numeric
by Abigail-II (Bishop) on Jun 13, 2002 at 12:54 UTC
    Yeah, if you use different delimiters you have to use the m. But he is not using different delimiters! If you run his code, you'll see it compiles fine. The parenthesis here just play their usual role: indicating precedence. They are not needed, but the don't change the meaning either, just as in: (3) + (4). So, all you have are strings on both sides of the binding operator. And Perl handles that just fine....

    Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://173767]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-12-10 09:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?