## beware! very much untested, it's incomplete, ## and it needs lots of error checking. use IO::File; sub import { ## if the module is a plain .pl file... my $fh = IO::File->new( $module ); local $/ = undef; my $text = <$fh>; undef $fh; my $caller_pkg = ((caller())[0] eval "package $caller_pkg; $text"; }