More VERSION tuning: to avoid unnecessary Perl upgrades
[p5sagit/p5-mst-13.2.git] / lib / Cwd.pm
index 4e4d39c..27a3105 100644 (file)
@@ -85,8 +85,10 @@ use base qw/ Exporter /;
 our @EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
 our @EXPORT_OK = qw(chdir abs_path fast_abs_path realpath fast_realpath);
 
-# Indicates if the XS portion has been loaded or not
-my $Booted = 0;
+eval {
+    require XSLoader;
+    XSLoader::load('Cwd');
+};
 
 # The 'natural and safe form' for UNIX (pwd may be setuid root)
 
@@ -123,19 +125,6 @@ sub getcwd
     abs_path('.');
 }
 
-# Now a callout to an XSUB.  We have to delay booting of the XSUB
-# until the first time fastcwd is called since Cwd::cwd is needed in the
-# building of perl when dynamic loading may be unavailable
-sub fastcwd {
-    unless ($Booted) {
-       require XSLoader;
-        XSLoader::load("Cwd");
-       ++$Booted;
-    }
-    return &Cwd::_fastcwd;
-}
-
-
 # Keeps track of current working directory in PWD environment var
 # Usage:
 #      use Cwd 'chdir';
@@ -206,17 +195,6 @@ sub chdir {
     1;
 }
 
-# Now a callout to an XSUB
-sub abs_path
-{
-    unless ($Booted) {
-        require XSLoader;
-        XSLoader::load("Cwd");
-        ++$Booted;
-    }
-    return &Cwd::_abs_path(@_);
-}
-
 # added function alias for those of us more
 # used to the libc function.  --tchrist 27-Jan-00
 *realpath = \&abs_path;