You are using the g modifier on the regex (why?). The first match positions pos($gw) after the 'c' so the subsequent match starts from there. For more info peruse Regexp Quote-Like Operators in perlop.
In reply to Re: Multiple if statements matching part of one variable problem
by GrandFather
in thread Multiple if statements matching part of one variable problem
by jmclark
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |