kingforce 发表于 2015-12-29 08:37:52

[Perl] 从pm文件中导入变量

  MyConfig.pm



package MyConfig;
use base qw(Exporter);
our @ISA    = qw(Exporter);
our @EXPORT = qw(%foo $bar);
our %foo = (
0, "A",
1, "B"
);
our @bar = (1, 2, 3);
  
Test.pl



use MyConfig;
print %foo;
print @bar;
  
页: [1]
查看完整版本: [Perl] 从pm文件中导入变量