Dan Sugalski ([EMAIL PROTECTED]) writes:
> At 12:27 PM 5/11/00 -0700, [EMAIL PROTECTED] wrote:
> >Looks like a good overall effort. However, isn't mentioning of either
> >$` or $' supposed to be an "evil slowdown to be avoided at all
> >cost" (tm) sort of thing? Might it be rejected?
> It's probably doomed because of that. Likely better to extend the regex out
> to expicitly capture the rest of the scalar through the end of the string.
Hmmm, somehow that 'evil slowdown' has previously escaped my notice.
BTW, note the other change in the REGEX: requiring that the
pattern match from the beginning of the string. The idea was
to avoid
/foo/bar/000000/blem
where the 000000 isn't a "device root".
Okay, here's a modified, not-evil-in-quite-the-same-way patch; note
that I use "$" for "end of string" (rather than \z) because we don't
really want newlines in VMS filespecs...
diff -uBb lib/File/Basename.pm-orig lib/File/Basename.pm
--- lib/File/Basename.pm-orig Wed May 10 09:47:58 2000
+++ lib/File/Basename.pm Thu May 11 22:55:07 2000
@@ -189,9 +189,13 @@
}
elsif ($fstype !~ /^VMS/i) { # default to Unix
($dirpath,$basename) = ($fullname =~ m#^(.*/)?(.*)#s);
- if ($^O eq 'VMS' and $fullname =~ m:/[^/]+/000000/?:) {
+ if ($^O eq 'VMS' and $fullname =~ m:^(/[^/]+/000000(/|$))(.*):) {
# dev:[000000] is top of VMS tree, similar to Unix '/'
- ($basename,$dirpath) = ('',$fullname);
+ # so strip it off and treat the rest as "normal"
+ my $devspec = $1;
+ my $remainder = $3;
+ ($dirpath,$basename) = ($remainder =~ m#^(.*/)?(.*)#s);
+ $dirpath = $devspec.$dirpath;
}
$dirpath = './' unless $dirpath;
}
diff -uBb t/pod/testp2pt.pl-orig t/pod/testp2pt.pl
--- t/pod/testp2pt.pl-orig Wed May 10 09:51:00 2000
+++ t/pod/testp2pt.pl Wed May 10 09:29:57 2000
@@ -42,7 +42,7 @@
sub catfile(@) { File::Spec->catfile(@_); }
my $INSTDIR = abs_path(dirname $0);
-$INSTDIR = VMS::Filespec::unixpath($INSTDIR) if $^O eq 'VMS';
+$INSTDIR = lc(VMS::Filespec::unixpath($INSTDIR)) if $^O eq 'VMS';
$INSTDIR =~ s#/$## if $^O eq 'VMS';
$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'pod');
$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 't');
--
Drexel University \V --Chuck Lane
----------------->--------*------------<[EMAIL PROTECTED]
(215) 895-1545 / \ Particle Physics [EMAIL PROTECTED]
FAX: (215) 895-5934 /~~~~~~~~~~~ [EMAIL PROTECTED]