my @fields = qw( opffile spec twig twigroot twigmeta error ); # This stmt is only executed once # the whole file is compiled. use fields @fields; # This line is executed as soon # as it is compiled.
Workaround:
my @fields; BEGIN { @fields = qw( opffile spec twig twigroot twigmeta error ); } # This block is executed as soon # as this line is compiled. use fields @fields; # This line is executed as soon # as it is compiled.
In reply to Re: When is "use module" not the same as require+import?
by ikegami
in thread When is "use module" not the same as require+import?
by AZed
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |