BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:
Calling test() the first succeeds. When it is called the second time in the loop, it traps?
I know it is non-sensical code, but it is the smallest reduction of the original that still demonstrates the problem. I just cannot see why?
#! perl -slw use strict; our $s = 'testtesttest'; our $t; sub test{ $t = $s; local *_ = \$t; our $i = 0; *_ = \substr($t, $i) while s[([a-z])(?{ $i=pos()+1 })][\U$1]; } test(); print "1 pass:$t"; test() for 1..2; print "After 2 pass:$t"; ## Never executed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: AS 5.8 segfaults -- but only on the second attempt?
by hv (Prior) on May 08, 2003 at 01:20 UTC | |
by BrowserUk (Patriarch) on May 08, 2003 at 01:49 UTC | |
|
Re: AS 5.8 segfaults -- but only on the second attempt?
by The Mad Hatter (Priest) on May 08, 2003 at 00:15 UTC | |
|
Re: AS 5.8 segfaults -- but only on the second attempt?
by cciulla (Friar) on May 08, 2003 at 00:47 UTC |