@@ -783,7 +783,7 @@ we have not made another match:
783
783
$1 is Mutt; $2 is Jeff
784
784
$1 is Wallace; $2 is Grommit
785
785
786
- If you are using Perl v5.16 or earlier, note that C<use
786
+ Due to an unfortunate accident of Perl's implementation, C<use
787
787
English> imposes a considerable performance penalty on all regular
788
788
expression matches in a program because it uses the C<$`>, C<$&>, and
789
789
C<$'>, regardless of whether they occur in the scope of C<use
@@ -800,9 +800,6 @@ Since Perl v5.10.0, you can use the C</p> match operator flag and the
800
800
C<${^PREMATCH}>, C<${^MATCH}>, and C<${^POSTMATCH}> variables instead
801
801
so you only suffer the performance penalties.
802
802
803
- If you are using Perl v5.18.0 or higher, you do not need to worry about
804
- this, as the three naughty variables are no longer naughty.
805
-
806
803
=over 8
807
804
808
805
=item $<I<digits>> ($1, $2, ...)
@@ -825,8 +822,7 @@ The string matched by the last successful pattern match (not counting
825
822
any matches hidden within a BLOCK or C<eval()> enclosed by the current
826
823
BLOCK).
827
824
828
- In Perl v5.16 and earlier, the use of this variable
829
- anywhere in a program imposes a considerable
825
+ The use of this variable anywhere in a program imposes a considerable
830
826
performance penalty on all regular expression matches. To avoid this
831
827
penalty, you can extract the same substring by using L</@->. Starting
832
828
with Perl v5.10.0, you can use the C</p> match flag and the C<${^MATCH}>
@@ -840,11 +836,9 @@ Mnemonic: like C<&> in some editors.
840
836
X<${^MATCH}>
841
837
842
838
This is similar to C<$&> (C<$MATCH>) except that it does not incur the
843
- performance penalty associated with that variable.
844
- In Perl v5.16 and earlier, it is only guaranteed
839
+ performance penalty associated with that variable, and is only guaranteed
845
840
to return a defined value when the pattern was compiled or executed with
846
- the C</p> modifier. In Perl v5.18, the C</p> modifier does nothing, so
847
- C<${^MATCH}> does the same thing as C<$MATCH>.
841
+ the C</p> modifier.
848
842
849
843
This variable was added in Perl v5.10.0.
850
844
@@ -859,8 +853,7 @@ The string preceding whatever was matched by the last successful
859
853
pattern match, not counting any matches hidden within a BLOCK or C<eval>
860
854
enclosed by the current BLOCK.
861
855
862
- In Perl v5.16 and earlier, the use of this variable
863
- anywhere in a program imposes a considerable
856
+ The use of this variable anywhere in a program imposes a considerable
864
857
performance penalty on all regular expression matches. To avoid this
865
858
penalty, you can extract the same substring by using L</@->. Starting
866
859
with Perl v5.10.0, you can use the C</p> match flag and the
@@ -875,11 +868,9 @@ Mnemonic: C<`> often precedes a quoted string.
875
868
X<$`> X<${^PREMATCH}>
876
869
877
870
This is similar to C<$`> ($PREMATCH) except that it does not incur the
878
- performance penalty associated with that variable.
879
- In Perl v5.16 and earlier, it is only guaranteed
871
+ performance penalty associated with that variable, and is only guaranteed
880
872
to return a defined value when the pattern was compiled or executed with
881
- the C</p> modifier. In Perl v5.18, the C</p> modifier does nothing, so
882
- C<${^PREMATCH}> does the same thing as C<$PREMATCH>.
873
+ the C</p> modifier.
883
874
884
875
This variable was added in Perl v5.10.0
885
876
@@ -898,8 +889,7 @@ enclosed by the current BLOCK). Example:
898
889
/def/;
899
890
print "$`:$&:$'\n"; # prints abc:def:ghi
900
891
901
- In Perl v5.16 and earlier, the use of this variable
902
- anywhere in a program imposes a considerable
892
+ The use of this variable anywhere in a program imposes a considerable
903
893
performance penalty on all regular expression matches.
904
894
To avoid this penalty, you can extract the same substring by
905
895
using L</@->. Starting with Perl v5.10.0, you can use the C</p> match flag
@@ -914,11 +904,9 @@ Mnemonic: C<'> often follows a quoted string.
914
904
X<${^POSTMATCH}> X<$'> X<$POSTMATCH>
915
905
916
906
This is similar to C<$'> (C<$POSTMATCH>) except that it does not incur the
917
- performance penalty associated with that variable.
918
- In Perl v5.16 and earlier, it is only guaranteed
907
+ performance penalty associated with that variable, and is only guaranteed
919
908
to return a defined value when the pattern was compiled or executed with
920
- the C</p> modifier. In Perl v5.18, the C</p> modifier does nothing, so
921
- C<${^POSTMATCH}> does the same thing as C<$POSTMATCH>.
909
+ the C</p> modifier.
922
910
923
911
This variable was added in Perl v5.10.0.
924
912
0 commit comments