Le Mar 10 Jan 2012 11:55:34, MITHALDU a écrit :
Show quoted text> I thought it would be obvious from the use of ok that i was importing it
> from Test::More, so i didn't mention it. Please consider this then to be
> the required mention:
>
> My code looked like this:
>
> no indirect;
> use Test::More;
> ok TestModule->marp;
>
> As you said, importing should declare the ok, so it would be known as a
> sub. But for whatever reason it actually is still interpreted as an
> indirect call. Would this be a bug in Perl itself?
Do you mean 'compiled' instead of 'interpreted'? Then this isn't true.
perl (5.8.9, 5.10.1, 5.12.4 and 5.14.1) correctly compiles your code as
a sub call, and indirect correctly doesn't complain :
$ perl -MO=Deparse -e 'no indirect; use Test::More; ok TestModule->marp'
no indirect;
use Test::More;
BEGIN {
$^H{'indirect'} = q(35359128);
}
ok 'TestModule'->marp;