package P; use vars qw($f); sub foo { print "$f\n" } package main; $P::f = "howdy, world"; P::foo(); __END__ output: howdy, world