in reply to perl pattern match for end of string using STDIN and chomp
Try inserting the statement
print qq{\$1 reset: '$1'} if 'foo' =~ /(foo)/;
between the first and second regex in that section and seeing what happens. If the second 'ZZZ' becomes 'foo' you will know what is happening (although not why the second regex fails to match, which I cannot understand myself).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl pattern match for end of string using STDIN and chomp
by Marshall (Canon) on Oct 08, 2009 at 23:43 UTC | |
|
Re^2: perl pattern match for end of string using STDIN and chomp
by cbolcato (Novice) on Oct 09, 2009 at 12:28 UTC |