与第二个示例相比,第一个带有 typeglob 的示例是否有缺点?
package Some::Module::Win32;
use strict;
use 5.10.0;
use Exporter 'import';
our @EXPORT_OK = qw(public);
use Some::Module;
*_func_one = \&Some::Module::_func_one;
*_func_two = \&Some::Module::_func_two;
*_func_three = \&Some::Module::_func_three;
sub public {
my $s = _func_one();
for my $i ( 0 .. $s ) {
say _func_two( $i );
}
say _func_three( $s );
}
1;
package Some::Module::Win32;
use strict;
use 5.10.0;
use Exporter 'import';
our @EXPORT_OK = qw(public);
use Some::Module;
sub public {
my $s = Some::Module::_func_one();
for my $i ( 0 .. $s ) {
say Some::Module::_func_two( $i );
}
say Some::Module::_func_three( $s );
}
1;