diff options
Diffstat (limited to 'lib/App/Mangemanche.pm')
-rw-r--r-- | lib/App/Mangemanche.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/App/Mangemanche.pm b/lib/App/Mangemanche.pm index d0992f2..228f8fc 100644 --- a/lib/App/Mangemanche.pm +++ b/lib/App/Mangemanche.pm @@ -126,17 +126,18 @@ sub list_commands { my @classpath = (split(/::/, $class), 'Command'); print "\nAvailable commands are:\n"; foreach my $mod (sort map { my $name = basename($_); - if (exists($INC{File::Spec->catfile(@classpath,$name)})) { + my $filename = File::Spec->catfile(@classpath,$name); + if (exists($INC{$filename})) { () } else { eval { - require $_; + require $filename; }; $name =~ s/\.pm$//; $@ ? () : [$name, $_]; } } map { |