in reply to Case Insensitivity on Windows
I assume that the reason you want to do this is to make sure that you've loaded a filename that matches the package name, since otherwise the module won't work.
You can do this by looking at the hash %packagename:: and making sure it has more than just the one import method that Perl puts in there. For example:
#!/usr/bin/perl use CGI; die "CGI not loaded" unless (keys(%CGI::) > 1); use cGi; die "cGi not loaded" unless (keys(%cGi::) > 1);
If you really want the filename, you can look the module up in the %INC hash, then open up its parent directory and scan the list of filenames returned for the one you want.
|
|---|