Created
April 16, 2011 19:16
-
-
Save trapd00r/923400 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings FATAL => 'all'; | |
my $module = 'IO::File'; | |
my @modules = @ARGV; | |
if(!@modules) { | |
@modules = qw( | |
IO::File | |
Term::ANSIColor | |
Test::More | |
Tie::File | |
Term::ReadLine | |
) | |
} | |
for my $module(@modules) { | |
eval "require $module"; | |
printf("%20.20s found in %s\n", $module, $INC{ module_to_path($module) } ); | |
} | |
# Translate IO::File to IO/File.pm so we can look it up in the %INC hash. | |
sub module_to_path { | |
my $m = shift; | |
my $f = $m; | |
$f =~ s{::}{/}g; | |
return "$f.pm"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment