aboutsummaryrefslogtreecommitdiff
path: root/lib/Example/Foobar
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-03-31 16:53:58 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-03-31 16:53:58 +0300
commite6ac6ca46dec80ef67e0c2efb21a412ff210b923 (patch)
tree8a88a6b24af43b81ceb8119055f2de067d668869 /lib/Example/Foobar
parent5c6c6ad5c68fc60b1c84f965a3ac9b4a1bd27d58 (diff)
downloadfoobar-e6ac6ca46dec80ef67e0c2efb21a412ff210b923.tar.gz
foobar-e6ac6ca46dec80ef67e0c2efb21a412ff210b923.tar.bz2
Fix duplicate load preventionHEADmaster
* lib/Example/Foobar/list.pm: strip location-specific parts of the pathname before looking up in %INC and loading. * lib/Example/Foobar.pm: Minor stylistic change.
Diffstat (limited to 'lib/Example/Foobar')
-rw-r--r--lib/Example/Foobar/list.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Example/Foobar/list.pm b/lib/Example/Foobar/list.pm
index 1096c03..f4b02a8 100644
--- a/lib/Example/Foobar/list.pm
+++ b/lib/Example/Foobar/list.pm
@@ -52,12 +52,13 @@ sub run {
foreach my $mod (sort
map {
my $name = basename($_);
- if (exists($INC{File::Spec->catfile($self->classpath,
- $name)})) {
+ my $filename = File::Spec->catfile($self->classpath,
+ $name);
+ if (exists($INC{$filename})) {
()
} else {
eval {
- require $_;
+ require $filename;
};
$name =~ s/\.pm$//;
$@ ? () : [$name, $_];

Return to:

Send suggestions and report system problems to the System administrator.