http://qs321.pair.com?node_id=713821


in reply to Re: who am I?
in thread who am I?

Other posters have given the canonical answers to this already, so I won't repeat them.

Just a word of caution: if you're using modules that put objects or CODE refs in the @INC array, i.e. potentially load code without reading from a file, either method will not work.

One such case are packaging modules such as PAR or ex::lib::zlib. So depending on how your module is used, the answer is: It's impossible to find its filename!

If you're going to write code that requires the location of the module file name, please think about it some more. It might not be the smartest way to solve your problem.

Cheers,
Steffen