diff options
-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 | |||
@@ -129,11 +129,12 @@ sub list_commands { | |||
129 | foreach my $mod (sort | 129 | foreach my $mod (sort |
130 | map { | 130 | map { |
131 | my $name = basename($_); | 131 | my $name = basename($_); |
132 | if (exists($INC{File::Spec->catfile(@classpath,$name)})) { | 132 | my $filename = File::Spec->catfile(@classpath,$name); |
133 | if (exists($INC{$filename})) { | ||
133 | () | 134 | () |
134 | } else { | 135 | } else { |
135 | eval { | 136 | eval { |
136 | require $_; | 137 | require $filename; |
137 | }; | 138 | }; |
138 | $name =~ s/\.pm$//; | 139 | $name =~ s/\.pm$//; |
139 | $@ ? () : [$name, $_]; | 140 | $@ ? () : [$name, $_]; |