in reply to When is "use module" not the same as require+import?
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.
|
|---|