[Perl] 從pm文件中導入變量

MyConfig.pmspa

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.plcode

use MyConfig;

print %foo;
print @bar;
相關文章
相關標籤/搜索