You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 11, 2024. It is now read-only.
{
# if the pattern gets silently re-parsed, ensure that any eval'ed# code blocks get the correct lexical scope. The overloading of# concat, along with the modification of the text of the code block,# ensures that it has to be re-compiled.
{
packageOL_MOD;
use overload
q{""}=>sub { my ($pat) = @_; $pat->[0] },
q{.}=>sub {
my ($a1, $a2) = @_;
$a1 = $a1->[0] ifref$a1;
$a2 = $a2->[0] ifref$a2;
my$s = "$a1$a2";
$s =~ s/x_var/y_var/;
bless [ $s ];
},
;
}
BEGIN {
overload::constant qr => sub { bless [ $_[0] ], 'OL_MOD' }; }$::x_var ="ABC";
my$x_var = "abc";
$::y_var = "XYZ";
my$y_var = "xyz";
use re 'eval';
my$a = 'a';
printqq[ok - 1\n]if"xyz" =~ m{^(??{ $x_var })$}; # OL_MODprintqq[ok - 2\n]if"xyza" =~ m{^(??{ $x_var })$a$}; # OL_MOD runtime"
}