X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FFile%2FSpec%2FVMS.pm;h=f8c488d51c28ff3b700a8f1bc70c4e2ba9b5edc4;hb=ff235dd6d6f5e19e11c9202d4a82fb8e5fbadadd;hp=539a93bcb4f5a33d19a58bde17d26e87b6ba0511;hpb=7e35a6a8bf1225db0ee95fcad4562a278d354f34;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/File/Spec/VMS.pm b/lib/File/Spec/VMS.pm index 539a93b..f8c488d 100644 --- a/lib/File/Spec/VMS.pm +++ b/lib/File/Spec/VMS.pm @@ -85,9 +85,10 @@ cases (e.g. elements other than the first being absolute filespecs). =cut sub catdir { - my ($self,@dirs) = @_; - my $dir = pop @dirs; - @dirs = grep($_,@dirs); + my $self = shift; + my $dir = pop; + my @dirs = grep {defined() && length()} @_; + my $rslt; if (@dirs) { my $path = (@dirs == 1 ? $dirs[0] : $self->catdir(@dirs)); @@ -118,9 +119,10 @@ VMS-syntax file specification. =cut sub catfile { - my ($self,@files) = @_; - my $file = $self->canonpath(pop @files); - @files = grep($_,@files); + my $self = shift; + my $file = $self->canonpath(pop()); + my @files = grep {defined() && length()} @_; + my $rslt; if (@files) { my $path = (@files == 1 ? $files[0] : $self->catdir(@files)); @@ -131,7 +133,7 @@ sub catfile { } else { $rslt = $self->eliminate_macros($spath); - $rslt = vmsify($rslt.($rslt ? '/' : '').unixify($file)); + $rslt = vmsify($rslt.((defined $rslt) && ($rslt ne '') ? '/' : '').unixify($file)); } } else { $rslt = (defined($file) && length($file)) ? vmsify($file) : ''; } @@ -425,7 +427,7 @@ sub rel2abs { # patch the ones in ExtUtils::MM_VMS instead. sub eliminate_macros { my($self,$path) = @_; - return '' unless $path; + return '' unless (defined $path) && ($path ne ''); $self = {} unless ref $self; if ($path =~ /\s/) {