in reply to Set a variable in calling package

Or is this more like something you had in mind:

File set_in_importing_script_1.pl
use warnings; use strict; use MyPackage; print $MyPackage::var;
File MyPackage.pm
# MyPackage.pm package MyPackage; use warnings; use strict; use MyUtils; 1;
File MyUtils.pm
# MyUtils.pm package MyUtils; use warnings; use strict; { no strict 'refs'; my $importing_package = (caller 0)[0]; ${ $importing_package . '::var' } = 42; } 1;
Output:
c:\@Work\Perl\monks\TerryBerry>perl set_in_importing_script_1.pl 42


Give a man a fish:  <%-{-{-{-<