my $pkg = "Foo"; my $var = "x"; $Foo::x = 123; { no strict 'refs'; print ${$pkg . '::' . $var}; } __END__ prints: "123";