my ($obj, $x);
our ($y, $bloop);
+sub expect {
+ my ($pkg) = @_;
+ return qr/^warn:Indirect call of method "(?:new|meh|$pkg$pkg)" on object "(?:$pkg|newnew|\$(?:[xy_]|(?:sploosh::)?sploosh|(?:main::)?bloop))"/
+}
+
{
local $/ = "####\n";
while (<DATA>) {
no indirect;
eval "die qq{the code compiled but it shouldn't have\n}; $_";
}
- like($@, qr/^warn:Indirect\s+call\s+of\s+method\s+"(?:new|meh|HlaghHlagh)"\s+on\s+object\s+"(?:Hlagh|newnew|\$[xy_]|\$(?:sploosh::)?sploosh|\$(?:main::)?bloop)"/, "no indirect: $_");
+ like($@, expect('Hlagh'), "no indirect: $_");
s/Hlagh/Dongs/g;
{
use indirect;
no indirect;
eval "die qq{the code compiled but it shouldn't have\n}; $_";
}
- like($@, qr/^warn:Indirect\s+call\s+of\s+method\s+"(?:new|meh|DongsDongs)"\s+on\s+object\s+"(?:Dongs|newnew|\$[xy_]|\$(?:sploosh::)?sploosh|\$(?:main::)?bloop)"/, "no indirect, defined: $_");
+ like($@, expect('Dongs'), "no indirect, defined: $_");
}
}