473,473 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

perl opening code line - need explanation:

51 New Member
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
1 1219
numberwhun
3,509 Recognized Expert Moderator Specialist
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

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

Similar topics

9
by: Xah Lee | last post by:
© # -*- coding: utf-8 -*- © # Python © © import sys © © nn = len(sys.argv) © © if not nn==5: © print "error: %s search_text replace_text in_file out_file" % sys.argv
2
by: Marty Meyers | last post by:
I have the following line in a php file: $msg= exec("perl $scriptPath/insert.pl $d $u $t 2>&1", $returnVal); Can someone explain the "2>&1" argument? Second problem, this same line of code...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
6
by: Lastknight | last post by:
Hi all I have googled and get the follwing expression for deleting the particular line of a perl program... perl -p -i -e"s/.*\n//" filename I am not able to understand the...
6
by: Paulchen | last post by:
Hello, I have found a perl script and need to "translate" this to PHP. I try to do it step by step and the first part of it is this function (the whole script is found at...
3
by: Max58kl | last post by:
Trying to access data and print it to the screen using Perl Builders I/O Window -------------------------------------------------------------------------------- Hi I am using a program called...
11
by: doraima29 | last post by:
Hi, I am a newbie at PERL and really wanted to understand how server-side programming really works and operates since I use at the workplace. I use ASP and wanted to learn more about server-side...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.