This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Comply with the 0x80th commandment
[perl5.git] / lib / File / CheckTree.pm
index 3da9f20..20ffd68 100644 (file)
@@ -1,12 +1,13 @@
 package File::CheckTree;
 
 use 5.006;
-use Exporter;
 use Cwd;
+use Exporter;
+use File::Spec;
 use warnings;
 use strict;
 
-our $VERSION = '4.2';
+our $VERSION = '4.3';
 our @ISA     = qw(Exporter);
 our @EXPORT  = qw(validate);
 
@@ -49,7 +50,9 @@ The routine returns the number of warnings issued.
 
 =head1 AUTHOR
 
-Unknown.  Revised by Paul Grassie <F<grassie@perl.com>> in 2002.
+File::CheckTree was derived from lib/validate.pl which was
+written by Larry Wall.
+Revised by Paul Grassie <F<grassie@perl.com>> in 2002.
 
 =head1 HISTORY
 
@@ -107,7 +110,8 @@ sub validate {
             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;