in reply to Set a variable in calling package
Or is this more like something you had in mind:
File MyPackage.pmuse warnings; use strict; use MyPackage; print $MyPackage::var;
File MyUtils.pm# MyPackage.pm package MyPackage; use warnings; use strict; use MyUtils; 1;
# MyUtils.pm package MyUtils; use warnings; use strict; { no strict 'refs'; my $importing_package = (caller 0)[0]; ${ $importing_package . '::var' } = 42; } 1;
c:\@Work\Perl\monks\TerryBerry>perl set_in_importing_script_1.pl 42
Give a man a fish: <%-{-{-{-<
|
|---|