in reply to Getting the package of evaluated source code:

package Foo; sub get_package { return __PACKAGE__; } 1;
Try this :)

Update: hmmm..if the compilation of the code fails, I can't get seem to get hold of it any other way than what you already have.

Update 2:Possible solution. If the code you're trying to pick up is always a package of some sort, you could re-arrange your logic like

package Foo; sub do_something { print __PACKAGE__,"\n"; } 1; -------------------------------- foreach ("Foo.pm") { eval { require $_; }; if ($@) { print "Error in $_\n"; print $@,"\n"; } } Foo::do_something();

/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"