Hello,
Thanks for your interest in subs::auto.
If I declare this package (also attached with this ticket) :
###############################
package X;
use strict;
use warnings;
require subs::auto;
sub import {
shift;
subs::auto->import(in => scalar caller);
}
1;
###############################
and load it, I get :
###############################
$ perl -MO=Deparse -e 'use X; fiesta 1'
use X;
BEGIN {
$^H{'subs::auto'} = '1';
}
fiesta(1);
-e syntax OK
###############################
which shows that subs::auto acted on the 'main' package. Likewise, if it
is loaded in another package, then the bareword is compiled into the
proper package as well :
###############################
$ perl5.16.1 -MO=Deparse -e 'package Y; use X; fiesta 1'
package Y;
sub BEGIN {
require X;
do {
'X'->import
};
}
BEGIN {
$^H{'subs::auto'} = '1';
}
fiesta(1);
-e syntax OK
###############################
Was this what you were looking for? If that's the case, make sure you're
using version 0.07 of subs::auto, as the previous ones were buggy in
that regard.
Vincent
package X;
use strict;
use warnings;
require subs::auto;
sub import {
shift;
subs::auto->import(in => scalar caller);
}
1;