Craig A. Berry [Thu, 11 Apr 2002 13:47:21 +0000 (08:47 -0500)]
From: "Craig A. Berry" <craigberry@mac.com>
Message-Id: <
a05101500b8db89763fbf@[172.16.52.1]>
p4raw-id: //depot/perl@15866
package File::CheckTree;
use 5.006;
-use Exporter;
use Cwd;
+use Exporter;
+use File::Spec;
use warnings;
use strict;
my $this = $test;
# expand relative $file to full pathname if preceded by cd directive
- $file = $cwd . '/' . $file if $cwd && $file !~ m|^/|;
+ $file = File::Spec->catfile($cwd, $file)
+ if $cwd && !File::Spec->file_name_is_absolute($file);
# put filename in after the test operator
$this =~ s/(-\w\b)/$1 "\$file"/g;
# cd directive followed by relative paths, followed by full paths
{
my ($num_warnings, @warnings, $path_to_libFile, $path_to_dist);
- $path_to_libFile = File::Spec->rel2abs('lib/File');
+ $path_to_libFile = File::Spec->rel2abs(File::Spec->catdir('lib','File'));
$path_to_dist = File::Spec->rel2abs(File::Spec->curdir);
local $SIG{__WARN__} = sub { push @warnings, "@_" };