http://qs1969.pair.com?node_id=1074642


in reply to Importing variables (not functions) from in-file packages

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";
use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name