Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: /usr/bin/perl^M: bad interpreter:

by Anonymous Monk
on Dec 03, 2009 at 07:38 UTC ( [id://810765]=note: print w/replies, xml ) Need Help??


in reply to /usr/bin/perl^M: bad interpreter:

If you end you shebang with " --", you don't have to worry about that
#!/usr/bin/perl --

Replies are listed 'Best First'.
Re^2: /usr/bin/perl^M: bad interpreter:
by JavaFan (Canon) on Dec 03, 2009 at 08:59 UTC
    #!/usr/bin/perl -- works for me, but #!/usr/bin/perl ^M -- doesn't.

    On what OS does -- tell the kernel to chop off a character from the path following the #!?

      Isn't the point that if the original shebang (on *nix) is:

      #!/usr/bin/perl --

      And the file gets downloaded to win in binmode it will become:

      #!/usr/bin/perl --^M

      And the ^M will then be ignored!


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
      '--' isn't used to 'chop off' any characters - when used, as BrowserUk implied earlier, it flags the end of the CLI option list to the script/executable and thus whatever follows (in this case the ^M) is/are arguments to the script/executable.

      The 'classic' usage is when grep'ping for a string containing dash(es) &/or minus(es) e.g. grep -- this-string some_file - which tells grep that 'this-string' is a string and not a malformed CLI option.

      A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://810765]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-24 01:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found