package Your::Dist::Version; # note no strict $VERSION = 1.23; sub import { my $pkg = caller; ${ "$pkg\::VERSION" } = $VERSION; } 1;