From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 09 October 2006 14:31
To: [email protected]
Subject: why we put #! /path/ of in the starting of line

> Hi
> Why do we put #! /(path of perl installed) in each file of perl( same
with shell) .. I know it tells the 
> shell(OS) where to pick the perl definition/modules
> but my doubt it what is the use of "!"  here .. as we know # is to
comment  line(comment means compiler will 
> not read that line ) then what is #! ?? 

This is essentially a unix-ism. When a unix(-like) os wants to execute a
file it looks at the first 2 bytes to determine what kind of executable
it is. If it happens to start with "#!" then it is assumed to be a
script of some kind, and the rest of the first line of the file contains
the path to the interpreter for that script, possibly with command line
switches as well.

This behaviour is sometimes supported on non-unix platforms (e.g. by
apache, I believe). If the #! line also contains "perl" then perl itself
will also make use of that line, as described in 'perldoc perlrun'.

HTH

-- 
Brian Raven 


=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for the 
intended addressee(s). Unauthorised reproduction, disclosure, modification, 
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message do not 
necessarily reflect those of Atos Euronext Market Solutions.

L'information contenue dans cet e-mail est confidentielle et uniquement 
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. 
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail 
vous parvient par erreur, nous vous prions de bien vouloir prevenir 
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre 
systeme. Le contenu de ce message electronique ne represente pas necessairement 
la position ou le point de vue d'Atos Euronext Market Solutions.

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to