summaryrefslogtreecommitdiff
path: root/lib/lib.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib.pm')
-rw-r--r--lib/lib.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/lib.pm b/lib/lib.pm
index 4d32f96355..6e6e15e4ce 100644
--- a/lib/lib.pm
+++ b/lib/lib.pm
@@ -18,6 +18,10 @@ sub import {
Carp::carp("Empty compile time value given to use lib");
# at foo.pl line ...
}
+ if (-e && ! -d _) {
+ require Carp;
+ Carp::carp("Parameter to use lib must be directory, not file");
+ }
unshift(@INC, $_);
# Put a corresponding archlib directory infront of $_ if it
# looks like $_ has an archlib directory below it.