in reply to Performance penalty of using qr//
outputs:$r = qr/(.)/; "a" =~ $r; print "$1\n"; { "b" =~ $r; print "$1\n"; } print "$1\n";
Thus a single regex object has to be associated with multiple capture sets, which change as scopes are exited.a b a
The current workaround for this is to duplicate the qr// object each time it's executed, which is sub-optimal. Unfortunately fixing this properly is non-trivial.
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Performance penalty of using qr//
by Anonymous Monk on Dec 21, 2017 at 13:22 UTC | |
by dave_the_m (Monsignor) on Dec 21, 2017 at 13:29 UTC | |
by Eily (Monsignor) on Dec 21, 2017 at 14:56 UTC | |
by dave_the_m (Monsignor) on Dec 21, 2017 at 20:01 UTC | |
by vr (Curate) on Dec 22, 2017 at 19:26 UTC |