From: Gurusamy Sarathy Date: Sat, 18 Jul 1998 22:27:59 +0000 (+0000) Subject: remove obsolete perltrap about m//g's pos() reset behavior X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7c1f0a780f6c3c384f7ab3ab896781a54a658b5f;p=p5sagit%2Fp5-mst-13.2.git remove obsolete perltrap about m//g's pos() reset behavior p4raw-id: //depot/perl@1541 --- diff --git a/pod/perltrap.pod b/pod/perltrap.pod index 8a3e3bc..1b954a3 100644 --- a/pod/perltrap.pod +++ b/pod/perltrap.pod @@ -1161,26 +1161,6 @@ repeatedly, like C or C. # perl5 prints: perl5 -=item * Regular Expression - -Under perl4 and upto version 5.003, a failed C match used to -reset the internal iterator, so that subsequent C match attempts -began from the beginning of the string. In perl version 5.004 and later, -failed C matches do not reset the iterator position (which can be -found using the C function--see L). - - $test = "foop"; - for (1..3) { - print $1 while ($test =~ /(o)/g); - # pos $test = 0; # to get old behavior - } - - # perl4 prints: oooooo - # perl5.004 prints: oo - -You may always reset the iterator yourself as shown in the commented line -to get the old behavior. - =back =head2 Subroutine, Signal, Sorting Traps