in reply to Pattern Matching Failing

if($ModNameList =~ m/$name/g) {

You are using the /g global option in scalar context so the regular expression keeps track of the current position in the string for the next match thereby bypassing matches that are to the left of the current match.

None of the patterns in your example require the use of the /g option.

Replies are listed 'Best First'.
Re^2: Pattern Matching Failing
by upallnight (Sexton) on Sep 30, 2007 at 03:21 UTC