On Sun, 18 Dec 2005 12:05:07 -0800, you wrote:

>At 09:03 PM 12/15/2005 -0800, Suresh Govindachar wrote:
>>  >>   1) What does the following line do? 
>>  >> 
>>  >>     eval 'exec C:\opt\perl\bin\perl.exe -S $0 ${1+"$@"}'
>>  >>         if 0;
>
>In perl it does nothing.  Under bash it executes perl with itself as an
>argument.  Although my tests indicate that double backslashes (C:\\...) and
>-x are required to make that trick work.  So I'm not sure what they were
>trying to accomplish with that.  In unix, 0 is "true" and <> 0 is false. :)
>The number represents the error level of the last exiting process.  "No
>error".  Keep in mind that normally this line will *never* be executed.
>Personally I think it's just left over development code that nobody deleted.

According to the Camel Book, those lines allow Perl scripts to be run
"naturally" (i.e., with "scriptname" instead of "perl scriptname") on
Unix systems that don't support #!. I don't imagine there are many of
those these days. There's no real point to it on Windows, unless your
system doesn't associate whatever extension you use on Perl scripts with
perl.exe.
-- 
Eric Amick
Columbia, MD
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to