in reply to finding module name?
perl -le 'package foo ;print eval('__PACKAGE__');' [download]
You don't need the eval; __PACKAGE__ doesn't interpolate by itself, but think of it as a package-scoped constant.