use File::Spec::Functions; sub use { my($pkg, @args) = @_; my(@dirs, $file) = split '::', $pkg; my $path = catfile @dirs, "$file.pm"; eval q< BEGIN { my($lib) = grep { -f cafile($_, $path) } @INC; my $code = IO::File->new(catfile $lib,$path) or die "ack - $!"; $INC{$path} = catfile $lib, $path; eval $code->getlines; $file->import(@args); } >; }