Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

As others have said, what you have is a shebang line for a script that has not yet been deployed.

What is to the right of the #! has no effect on Windows systems, as these find perl using a file type association, or the script gets turned into a .bat file with a different preamble. If the line could be parsed into a perl command and options, e.g. -w these options would be applied.

Unix systems expect to see the full path to perl. Sometimes #!perl will work via $ENV{PATH}, but this is considered unreliable and insecure.

The standard script installing mechanism used by ExtUtils::MakeMaker invokes MY->fixin over each script. This will cause your placeholder shebang line to be replaced with a real one that has a path to perl. The fixin method does different things depending on your platform, for example it runs pl2bat on Windows.

On Unix, fixin does the following:

  • Extract the command and any arguments

  • If the command is the string 'perl' get the interpreter path from $Config{startperl}.

  • Else if there was a different command parsed out, use $Config{perlpath}

  • Otherwise, try and find the perl executable by looking in the path.

--

Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)


In reply to Re: Perl interpretation of weird #! line by rinceWind
in thread Perl interpretation of weird #! line by jesuashok

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 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? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2022-05-21 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (78 votes). Check out past polls.

    Notices?