in reply to ${^POSTMATCH} problem
Internally, the expression is essentially saving a reference to ${^POSTMATCH}, which it will fetch from later when it does the concatenation. Depending on the order that the concatenation is performed in, this can lead to varied results. Small changes in implementation can impact this, but most likely this changed due to the introduction of the multiconcat op.
You can force early fetching of the ${^POSTMATCH} variable by putting it in double quotes. This can be a good practice in other places when using regular expression globals, such as when passing match variables ("$1", "$2") to functions.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: ${^POSTMATCH} problem
by LanX (Saint) on Jun 14, 2020 at 14:31 UTC | |
Re^2: ${^POSTMATCH} problem
by pl_pm (Initiate) on Jun 21, 2020 at 19:22 UTC |
In Section
Seekers of Perl Wisdom