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(;;);
In reply to Re: Matching Part of a String in a IF Statment
by murugu
in thread Matching Part of a String in a IF Statment
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |