in reply to Odd regex results with g switch

m//g in a scalar context maintains a pos value. See perldoc -tf pos and perldoc perlre for details. Your results are entirely as expected to me.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: Odd regex results with g switch
by JamesNC (Chaplain) on Oct 30, 2005 at 13:12 UTC
    thank you