Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
The #! combination of characters is known as the "hash-bang". I don't know why it is called bang.. I thought it was an exclamation mark myself, but I suspect an American thought it would be cute to give that character a shorter name.

The #! characters are interpreted by linux/unix shells to mean "run whatever program follows, then pass the text on all subsequent lines to that program". It's a simple way of constructing scripts in any language, merely by defining which interpreter should be used on the first line of the script.

As the previous poster attests, you don't need it in windows. That's because windows is different to linux in that it determines which program to run your file by the file extension (in most cases this will be .pl on your system). Alternatively you can run your perl scripts by typing "perl <filename>".

There is one situation where you must provide the "hash-bang" on scripts in windows - this is in Apache for Win32, when executing perl CGI scripts. Apparently Apache looks for which interpreter to use based on the first line of any CGI scripts.


In reply to Re: Clarify My doubt on #!/usr/local/bin/perl by monarch
in thread Clarify My doubt on #!/usr/local/bin/perl by kprasanna_79

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-26 04:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found