The beauty of our is that there is no need to export within the same file. It works lexically.
use strict; use warnings; package MyPackage; # temporarily step into MyPackage our $globalVar; package main; # back to main $globalVar = 42; print $MyPackage::globalVar, "\n";
In reply to Re: Importing variables (not functions) from in-file packages
by tobyink
in thread Importing variables (not functions) from in-file packages
by puterboy
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |