belg4mit has asked for the wisdom of the Perl Monks concerning the following question:
Brother smgfc asked in the chatterbox for help considering an infinite loop involving
I surmised that we needed to track pos for ourselves. Fine. Printing it from within the loop works just fine. However, attempting to set a scalar to the value returned by pos, doesn't. Trying to be clever, I also tried to side-step the issue with# substr no good, this is a simplified regexp while( ($b, $c) = $a =~ /(.)(.)/g ){ #do stuff }
which proceeded to also do a whole lot of nothing. So I inquire, what and why is this bizarre behavior?$p = pos($a) ? 1 : 0;
--
perl -pe "s/\b;([st])/'\1/mg"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: puzzled by pos
by jeffa (Bishop) on Mar 30, 2002 at 01:02 UTC | |
|
Re: puzzled by pos
by zengargoyle (Deacon) on Mar 30, 2002 at 01:07 UTC | |
by belg4mit (Prior) on Mar 30, 2002 at 01:11 UTC | |
|
Re: puzzled by pos
by belg4mit (Prior) on Mar 30, 2002 at 02:50 UTC | |
|
Re: puzzled by pos
by gmax (Abbot) on Mar 30, 2002 at 14:31 UTC | |
|
Re: puzzled by pos
by YuckFoo (Abbot) on Mar 30, 2002 at 22:03 UTC |