467,114 Members | 1,301 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,114 developers. It's quick & easy.

perl opening code line - need explanation:


i've encountered a script which has the following code line on top:

Expand|Select|Wrap|Line Numbers
  1. eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' & eval 'exec perl -w -S $0 $argv:q'

can anybody explain me what does it says. the only initials i've seen so far are !#/usr/bin/perl, which tells the server where to look for the perl interpreter .

Jun 8 '08 #1
  • viewed: 1097
1 Reply
Expert Mod 2GB
Not knowing whether this is homework you are supposed to work out or not, I will provide you with a couple of places you can start looking.

First, the command line options to perl can be found on the perlrun page. That site, perldoc.perl.org, is also an excellent reference for the language.

Also, in the beginning, there is a "$?0". To me, this makes no sense because the $? is the 16 bit status word returned by the last wait or waitpid syscall. I don't think the zero should be there.

My suggestion, since you are learning, is to figure this out. You should be able to figure out what it is doing using the perldoc page, among others.


Jun 9 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.