summaryrefslogtreecommitdiff
path: root/lib/File
diff options
context:
space:
mode:
Diffstat (limited to 'lib/File')
-rw-r--r--lib/File/Basename.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/File/Basename.pm b/lib/File/Basename.pm
index 69bb1fa5fd..191eff970a 100644
--- a/lib/File/Basename.pm
+++ b/lib/File/Basename.pm
@@ -124,7 +124,17 @@ directory name to be F<.>).
## use strict;
-use re 'taint';
+# A bit of juggling to insure that C<use re 'taint';> awlays works, since
+# File::Basename is used during the Perl build, when the re extension may
+# not be available.
+BEGIN {
+ unless (eval { require re; })
+ { eval ' sub re::import { $^H |= 0x00100000; } ' }
+ import re 'taint';
+}
+
+
+
require Exporter;
@ISA = qw(Exporter);