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>