in reply to Re^8: Global regex giving up too soon
in thread Global regex giving up too soon
An infinite loop with 1 whilemy $str = join ' ', map {"$_-PAT"} 1 .. 10; warn $str; 1 while $str =~ s/PAT/REPL/; die $str; __END__ 1-PAT 2-PAT 3-PAT 4-PAT 5-PAT 6-PAT 7-PAT 8-PAT 9-PAT 10-PAT at - line + 2. 1-REPL 2-REPL 3-REPL 4-REPL 5-REPL 6-REPL 7-REPL 8-REPL 9-REPL 10-REPL + at - line 4.
my $str = 'A b and A and c and A'; warn $str; $str =~ s/A/a/i for 1,2,3; die $str; __END__ A b and A and c and A at - line 3. a b and A and c and A at - line 5.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Global regex giving up too soon
by Coruscate (Sexton) on Jan 20, 2004 at 13:18 UTC | |
by Abigail-II (Bishop) on Jan 20, 2004 at 13:30 UTC | |
by Coruscate (Sexton) on Jan 20, 2004 at 13:43 UTC |