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
In Section
Seekers of Perl Wisdom