On Thu, Sep 19, 2013 at 10:29:37PM -0500, Craig A. Berry wrote: > > On Sep 19, 2013, at 1:36 PM, Nicholas Clark <n...@ccl4.org> wrote: > > > So, my question is, surely that file should be installed as > > "utils/perldoc.COM" not "utils/perldoc"? > > Yes.
Would anyone notice if it wasn't installed as utils/perldoc? (This might be related to the question below) > > And if so, where in ExtUtils::MakeMaker does it need fixing? > > Good question. ExtUtils::MakeMaker::MM_Unix::installbin says: > > =item installbin (o) > > Defines targets to make and to install EXE_FILES. > > but I think it's lying. It doesn't seem to "make" anything at all but mostly > copies files into place after fiddling with the shebang line. I think there > is also some special handling if it finds POD in the file. I suppose the > file copy line in there should append .com if it's not already present. It seems to. I've just mailed perl5-porters a result of digging some more: In that, as best I can tell, on all platforms the makefile copies the script to the $(INST_SCRIPT) directory, and then runs the $(FIXIN) command: $(INST_SCRIPT)/shasum : shasum $(FIRST_MAKEFILE) $(INST_SCRIPT)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(NOECHO) $(RM_F) $(INST_SCRIPT)/shasum $(CP) shasum $(INST_SCRIPT)/shasum $(FIXIN) $(INST_SCRIPT)/shasum -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/shasum On *nix the FIXIN command is this FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' -- and on VMS just the quoting differs: FIXIN = $(ABSPERLRUN) "-MExtUtils::MY" -e "MY->fixin(shift)" "--" MY->fixin calls the fixin() method, which uses $Config{startperl} to change the #! line However, the filename is unchanged. On Win32, the FIXIN command appears to be this: FIXIN = $(PERLRUN) ../../win32/bin/pl2bat.pl As best I can tell, in the case pl2bat.pl would create a shasum.bat file within $(INST_SCRIPT) As far as the perl core goes, I believe that ./installperl will *only* install shasum.bat However, if one builds Digest::SHA (or Pod::Perldoc, or anything else) from a tarball, does it end up with both shasum and shasum.bat being installed? __END__ So it looks like the FIXIN command would be the correct place to do such a renaming. Or duplicating. > > (Does anyone on VMS actually install modules from CPAN that have scripts?) > > Probably rarely. And installing it wouldn't let you run it automatically > anyway unless you happen to put perl_root:[utils] into DCL$PATH. The reason > you had it still looking for perldoc.com even after you deleted that file is > because there is a foreign command for perldoc defined in perl_setup.com > (more or less like an alias as John said). Yes, I'd spotted that before I mailed. (I didn't say that, sorry) So it looks like on Win32, both foo and foo.bat are installed, but foo and foo.bat differ. Whereas, if I've got VMS figured out, foo and foo.com would be identical, because $Config{startperl} is this: $ perl 'f$env("procedure")' "''p1'" "''p2'" "''p3'" "''p4'" "''p5'" "''p6'" "''p 7'" "''p8'"! $ exit++ + ++$status!=0 and $exit=$status=undef; while($#ARGV != -1 and $ARGV[$# ARGV] eq ''){pop @ARGV;} #!perl and ALTERNATE_SHEBANG is defined as "$", resulting in toke.c skipping over the first line. The other 2 are valid perl, as B::Deparse demonstrates: $ perl -"MO=Deparse" [.perl-58583d21ac03_ROOT.utils]perldoc.com $exit = $status = undef if $exit++ + ++$status != 0; while ($#ARGV != -1 and $ARGV[$#ARGV] eq '') { pop @ARGV; } require 5; sub BEGIN { $^W = 1 if $ENV{'PERLDOCDEBUG'}; } use Pod::Perldoc; exit 'Pod::Perldoc'->run; So, I guess next VMS question is: Is it actually necessary to install both (eg) perldoc and perldoc.com? In that, ignoring backwards compatibility with what people expect 1) We seem to have a discrepancy between what the core installs for perldoc, and what a CPAN update installs 2) We seem to have a discrepancy between scripts installed by the core ("foo.com") and scripts installed by non-core modules (just "bar") 3) It would make the core build process a lot easier if ExtUtils::MakeMaker did the ".com" trick, as it's already doing the ".bat" dance for Win32, because this would permit a lot of simplification of the utils/ directory. Nicholas Clark