By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,541 Members | 1,427 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,541 IT Pros & Developers. It's quick & easy.

perl opening code line - need explanation:

P: 51
Hello,

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'
  2.  

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 .

thanks,
Jun 8 '08 #1
Share this Question
Share on Google+
1 Reply


numberwhun
Expert Mod 2.5K+
P: 3,503
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.

Regards,

Jeff
Jun 9 '08 #2

Post your reply

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