use strict;
-use Carp;
-
our $VERSION = '2.08';
use base qw/ Exporter /;
unless (@cst = stat( $start ))
{
- carp "stat($start): $!";
+ require Carp;
+ Carp::carp ("stat($start): $!");
return '';
}
$cwd = '';
local *PARENT;
unless (opendir(PARENT, $dotdots))
{
- carp "opendir($dotdots): $!";
+ require Carp;
+ Carp::carp ("opendir($dotdots): $!");
return '';
}
unless (@cst = stat($dotdots))
{
- carp "stat($dotdots): $!";
+ require Carp;
+ Carp::carp ("stat($dotdots): $!");
closedir(PARENT);
return '';
}
{
unless (defined ($dir = readdir(PARENT)))
{
- carp "readdir($dotdots): $!";
+ require Carp;
+ Carp::carp ("readdir($dotdots): $!");
closedir(PARENT);
return '';
}
($path) = $path =~ /(.*)/;
($cwd) = $cwd =~ /(.*)/;
- CORE::chdir($path) || croak "Cannot chdir to $path: $!";
+ if (!CORE::chdir($path)) {
+ require Carp;
+ Carp::croak ("Cannot chdir to $path: $!");
+ }
my $realpath = getcwd();
- -d $cwd && CORE::chdir($cwd) ||
- croak "Cannot chdir back to $cwd: $!";
+ if (! ((-d $cwd) && (CORE::chdir($cwd)))) {
+ require Carp;
+ Carp::croak ("Cannot chdir back to $cwd: $!");
+ }
$realpath;
}
sub _vms_abs_path {
return $ENV{'DEFAULT'} unless @_;
my $path = VMS::Filespec::pathify($_[0]);
- croak("Invalid path name $_[0]") unless defined $path;
+ if (! defined $path)
+ {
+ require Carp;
+ Carp::croak("Invalid path name $_[0]")
+ }
return VMS::Filespec::rmsexpand($path);
}