Note that %INC (and likely @INC) is actually a global global. That is, it is available in every package:
Works just fine. ;-) I make minor changes to your example because I didn't use a "normally named" package to put whence into.package Foo; sub whence { my $fp = shift; $fp =~ s=::=/=g; $fp .= '.pm'; $INC{$fp} } package main; use warnings; print Foo::whence('warnings'),$/;
In reply to Re^2: returning filename of module used
by Tanktalus
in thread returning filename of module used
by bengmau
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |