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