Use a look-behind assertion. Rather than looking for the string 'module ' then testing if the $ARGV[2] string follows, look for the $ARGV[2] string and see if it is preceded by the string 'module '.
my $match = "(?<=module )$ARGV[2]"Using Look-ahead and Look-behind
In reply to Re: Bug in script, regex help req extreme urgent
by Don Coyote
in thread Bug in script, regex help req extreme urgent
by sid.verycool
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |