From: Father Chrysostomos Date: Sat, 4 Nov 2017 14:09:38 +0000 (+0100) Subject: Handle CVs in stash properly X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=15e8aee3134261e68b8ce558d76dade6f9bd7af2;p=perl%2Fmodules%2FVPIT-TestHelpers.git Handle CVs in stash properly --- diff --git a/lib/VPIT/TestHelpers.pm b/lib/VPIT/TestHelpers.pm index 10550ee..f47bee1 100644 --- a/lib/VPIT/TestHelpers.pm +++ b/lib/VPIT/TestHelpers.pm @@ -97,7 +97,9 @@ my $test_sub = sub { } my $glob = $stash->{$sub}; - return $glob ? *$glob{CODE} : undef; + return ref \$glob eq 'GLOB' ? *$glob{CODE} + : ref $glob eq 'CODE' ? $glob + : undef; }; sub skip { $test_sub->('skip')->(@_) }