$ cat tt.pl sub foo { print "bar\n" } $ cat ttmain.pl package x; eval `cat tt.pl`; x::foo(); $ perl ttmain.pl bar