develooper Front page | perl.qpsmtpd | Postings from January 2007

Re: strange forkserver code

Thread Previous | Thread Next
Peter J. Holzer
January 9, 2007 09:18
Re: strange forkserver code
Message ID:
On 2007-01-09 11:19:46 -0500, Guy Hulbert wrote:
> On Tue, 2007-09-01 at 14:10 +0000,
> wrote:
> > The one in /usr/bin has this at the top of the file:
> > 
> > #!/usr/bin/perl -Tw
> > 
> > eval 'exec /usr/bin/perl -Tw -S $0 ${1+"$@"}'
> >     if 0; # not running under some shell
> > 
> > I realise that this does nothing, but just wondered why it was in the
> > make install version and not in the raw tar ball one.
> It's required on platforms which don't know about '#!' (e.g. windows).

I'm quite sure that Windows can't expand ${1+"$@"} either.

That's for Unixes which don't know about #! and execute everything which
isn't binary using the Bourne shell. I don't know if any such Unix still
exists and if it needs ${1+"$@"} instead of "$@", but once upon a time
it was needed and it does no harm (the lines are carefully constructed
to be both valid Perl and valid sh commands).

> > Would I be correct in thinking that I should continue to use the raw
> > tar ball code and not start pointing to the "make install" version of
> > everything?

Your choice. "make install" replaces the #! line with one suitable for
the local system (perl isn't installed in /usr/bin on all systems) and
installs everything into system-standard locations. I went that route
for the RPM packages and Devin did the same for the Debian Packages. For
a local install you may or may not want that, depending whether you're a
fan of the FHS or of the "one directory-tree per package" philosophy.

> I have not heard of anyone running it from the installed version like
> this yet.  I'm not brave enough to try :-).

Everybody who uses the Debian packages or RPMs, does.

> There is a debian package of 0.32 for the pending release (etch) and
> this would use the "make install" version but Debian does their own q.a.
> and patches.

I can't speak for Devin, but as the maintainer of the RPMs I can say
that I do try to get any changes necessary back upstream (not always to
the delight of the core maintainers :-)).


   _  | Peter J. Holzer    | I know I'd be respectful of a pirate 
|_|_) | Sysadmin WSR       | with an emu on his shoulder.
| |   |         |
__/   | |	-- Sam in "Freefall"

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About