[posted & mailed]
On Tue, 10 Aug 2004, LEH wrote:
>this does work, but I am still curious to know why my capturing into a
>variable resets pos($string)
>
>> while (($capture)=$string=~m/($searchpattern)/g)
The problem is that saying
(...) = $string =~ /pattern/g;
enforces *list* context on the pattern match, and a global pattern match
in list context matches as many times as possible, and afterwards, pos()
doesn't have a useful value.
--
Jeff "japhy" Pinyan % How can we ever be the sold short or
RPI Acacia Brother #734 % the cheated, we who for every service
RPI Corporation Secretary % have long ago been overpaid?
http://japhy.perlmonk.org/ %
http://www.perlmonks.org/ % -- Meister Eckhart