Skip to content

Commit

Permalink
Autosplit doesn't like upper case letters in sub names on VMS
Browse files Browse the repository at this point in the history
Autosplit.PM mis-behaves a bit on VMS. When it creates its auto-split
.al files, it assumes that the filename will be the same as the sub name
including case. This turns out not to be the case for VMS, whose file
system upcases all filenames, and whose CRTL then downcases all filenames.
Any sub whose name has an uppercase letter in it will end up with a file with
an all-lowercase name.

This would not be a problem, except that the autosplit_file sub then goes and
deletes any .al files whose names do not exactly match (including case) the
names of a sub. This nukes the (lower-cased filename) files for any sub
that's got upper-case letters in its name, which pretty much kills the module
build.

The following patch fixes this for VMS. Current behavior's preserved for
everyone else, of course. (The -V output at the end is incorrect in this
case--the patch was made to my 5.004_04 sources, and tested with them)

p5p-msgid: 3.0.5.32.19980330152332.009cb130@osshe.edu
  • Loading branch information
Dan Sugalski authored and Tim Bunce committed May 15, 1998
1 parent 1140ace commit fa79461
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/AutoSplit.pm
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,16 @@ sub autosplit_file{

if (!$keep){ # don't keep any obsolete *.al files in the directory
my(%names);
@names{@names} = @names;
# perl downcases all filenames on VMS (which upcases all filenames) so
# we'd better downcase the sub name list too, or subs with upper case
# letters in them will get their .al files deleted right after they're
# created. (The mixed case sub name wonn't match the all-lowercase
# filename, and so be cleaned up as a scrap file)
if ($Is_VMS) {
%names = map {lc($_) => lc($_) } @names;
} else {
@names{@names} = @names;
}
opendir(OUTDIR,"$autodir/$modpname");
foreach(sort readdir(OUTDIR)){
next unless /\.al$/;
Expand Down

0 comments on commit fa79461

Please sign in to comment.