Re: Launching perl scripts on systems which do not support #!

2008-06-21 Thread Paul Johnson
On Sat, Jun 21, 2008 at 06:19:46PM +0100, Rob Dixon wrote: > gowthamgowtham wrote: > > > > I found this in Programming Perl - 3rd edition. Could not understand how > > this works. > > What is it supposed to do? Does it work? Have you tried it? How is it supposed > to be run? It's a clever little

Re: Launching perl scripts on systems which do not support #!

2008-06-21 Thread Brad Baxter
On Jun 21, 4:11 am, [EMAIL PROTECTED] (Gowthamgowtham) wrote: > Hello All, > > I found this in Programming Perl - 3rd edition. Could not understand how > this works. > > #!/bin/sh -- # perl, to stop looping > > eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' > > if 0; > > Questions: > > - Wh

Re: Launching perl scripts on systems which do not support #!

2008-06-21 Thread Rob Dixon
gowthamgowtham wrote: > > I found this in Programming Perl - 3rd edition. Could not understand how > this works. What is it supposed to do? Does it work? Have you tried it? How is it supposed to be run? I've had a quick look through the book and can find nothing like it. It is either very esoter

Launching perl scripts on systems which do not support #!

2008-06-21 Thread gowthamgowtham
Hello All, I found this in Programming Perl - 3rd edition. Could not understand how this works. #!/bin/sh -- # perl, to stop looping eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; Questions: - Who (I mean which program/shell) runs eval 'exec .'? - What is $