On Thu, Oct 07, 2010 at 02:01:13PM -0500, Craig A. Berry wrote:

> I corrected this with:
> 
> commit 9ed9b795caa408a925999e1d90f9932e35b3ab10
> Author: Craig A. Berry <craigbe...@mac.com>
> Date:   Wed Oct 6 19:19:33 2010 -0500
> 
>     No distinction between .PL and .pl if case is not preserved.
> 
>     Follow-up to 13b5e8d8173af2197798ae78b4520ece8cb1151c.
> 
>     On VMS, the CRTL downcases filenames by default, so pod2foo.PL
>     comes through as pod2foo.pl.  We need to match that so we paste
>     on the right extension for the generated command procedure.

Thanks.

> It doesn't generate anything per se.  It copies [.scripts]cpan as  
> distributed with the module to [.blib.script]cpan, then runs  
> Extutils::MakeMaker::MM_Unix->fixin on the result, which (incorrectly  
> on VMS) pastes a shebang line on the beginning, replacing any shebang  
> line already there.  This based on building CPAN 1.94_61 just now.

Thanks for testing this.

> In the core, utils/cpan.PL is simply a wrapper that sucks in cpan/CPAN/ 
> scripts/cpan, puts $Config{startperl} at the beginning, and writes it  
> back out.  There are a bunch of these that all have identical code  
> except for the name of the utility, so one obvious rationalization  
> would be to put that code in one script and have it work through a  
> list of utilities to be generated.

Agree. But

1: I remember having to alter those paths when modules moved from ext/ to
   dist/ or cpan/, and it felt like makework, so I wanted to kill it properly
2: When building these modules from a CPAN download, ExtUtils::MakeMaker
   already has to do all this extraction work , shebang rewriting, running
   pl2bat, so surely it could do it when the modules are in the core


which, I felt, would remove even more code from core :-)

[Clearly this doesn't work if it hasn unresolved a bug in this area for VMS]

With the pod*PL extractors, by moving them all out of pod/ (including creating
ext/Pod-HTML for Pod::Html, which isn't dual-life), it let me remove several
rules from the various Makefiles. It might be that if we can move all of
utils/ into its modules, or into ext/utils, we can further simplify the top
level Makefiles, and let make_ext.pl and ExtUtils::MakeMaker do the work.

> fixin() and the various *.PL scripts in utils have two different  
> understandings of what $Config{startperl} is and how to use it.  
> The .PL scripts have it right as far as VMS is concerned, so it looks  
> like we need to fix fixin().

This would be useful.

> Side note: this extraction process in the core is a bit strange on  
> Unix.  You end up with two shebang lines in the utilities distributed  
> with the core:
> 
> #!/usr/local/bin/perl
>     eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
>         if $running_under_some_shell;
> #!/usr/local/bin/perl
> . . .
> 
> I assume the first one takes precedence since the second one will  
> never be seen by the shell.

I assume this too.

Nicholas Clark

Reply via email to