Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Matching Part of a String in a IF Statment

by murugu (Curate)
on Dec 12, 2005 at 09:06 UTC ( [id://515970]=note: print w/replies, xml ) Need Help??


in reply to Matching Part of a String in a IF Statment

Hi awohld,

Its not matching because, it's trying to match '$city' i.e $city doesn't get interpolated.

Remove that \ before $city, then it will match. You should also add boundary condition \b to the expression so that the you can do exact string match. (i.e)substring matches can be avoided

Regards,
Murugesan Kandasamy
use perl for(;;);

  • Comment on Re: Matching Part of a String in a IF Statment

Replies are listed 'Best First'.
Re^2: Matching Part of a String in a IF Statment
by Fletch (Bishop) on Dec 12, 2005 at 14:57 UTC

    Technically it's trying to match $cit followed by one or more of y</pedant>

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2024-04-18 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found