in reply to Which Library Am I Using?

I have the feeling I might be missing some aspect of your script, but I suppose the easiest way to find that out is to volunteer something that I think is equivalent, and find out if it is. That said, the following one-liner does roughly the same thing that I think you're doing above, rather faster:

perl -le '$mod = shift; eval "use $mod;1;" or die $@; $mod =~ s/::/\// +g; print $INC{$mod.".pm"}' Some::Module

(It also doesn't fail on an argument of "FileHandle", which I think yours might.)

Of course, it also does the same thing as perldoc -l Some::Module, but that's a side-issue. :-)



If God had meant us to fly, he would *never* have given us the railroads.
    --Michael Flanders