@@ -2056,15 +2056,15 @@ The bottom line is that using C</o> is almost never a good idea.
2056
2056
2057
2057
If the I<PATTERN> evaluates to the empty string, the last
2058
2058
I<successfully> matched regular expression in the current dynamic
2059
- scope is used instead. In this case, only the C<g> and C<c> flags on
2060
- the empty pattern are honored; the other flags are taken from the
2061
- original pattern. If no match has previously succeeded, this will
2062
- (silently) act instead as a genuine empty pattern (which will always
2063
- match). Using a user supplied string as a pattern has the risk that if
2064
- the string is empty that it triggers the "last successful match"
2065
- behavior, which can be very confusing. In such cases you are
2066
- recommended to replace C<m/$pattern/> with C<m/(?:$pattern)/> to avoid
2067
- this behavior.
2059
+ scope is used instead (see also L<perlvar/Scoping Rules of Regex Variables>).
2060
+ In this case, only the C<g> and C<c> flags on the empty pattern are
2061
+ honored; the other flags are taken from the original pattern. If no
2062
+ match has previously succeeded, this will (silently) act instead as a
2063
+ genuine empty pattern (which will always match). Using a user supplied
2064
+ string as a pattern has the risk that if the string is empty that it
2065
+ triggers the "last successful match" behavior, which can be very
2066
+ confusing. In such cases you are recommended to replace C<m/$pattern/>
2067
+ with C<m/(?:$pattern)/> to avoid this behavior.
2068
2068
2069
2069
The last successful pattern may be accessed as a variable via
2070
2070
C<${^LAST_SUCCESSFUL_PATTERN}>. Matching against it, or the empty
0 commit comments