Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: It LOOKS right...

by toolic (Bishop)
on May 31, 2011 at 17:26 UTC ( [id://907507]=note: print w/replies, xml ) Need Help??


in reply to It LOOKS right...

#! usr/bin/perl
Try adding a / before usr:
#!/usr/bin/perl
When I do that, it prints "Hello World!" for me.

See also: Shebang_(Unix)

Replies are listed 'Best First'.
Re^2: It LOOKS right...
by BIOM01 (Initiate) on May 31, 2011 at 17:31 UTC
    It's not the actual "Hello World" statement that I'm asking about. It's the error message I'm getting.

      If the #! line isn't correct then your code will be passed to /bin/sh, not Perl, and that's what produced the error messages.

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

        If the #! line isn't correct then your code will be passed to /bin/sh, not Perl

        No.

        $ a.pl sh: ./a.pl: usr/bin/perl: bad interpreter: No such file or directory

        and that's what produced the error messages.

        No. If the error messages originated from sh, they would look like

        $ . a.pl sh: =: command not found sh: ./a.pl: line 3: syntax error near unexpected token `{' sh: ./a.pl: line 3: `if ($count <= 20) {'

        or (requires changing shebang to #!/bin/sh)

        $ a.pl ./a.pl: line 2: =: command not found ./a.pl: line 3: syntax error near unexpected token `{' ./a.pl: line 3: `if ($count <= 20) {'

        The error the OP gave is indeed from perl.

      When I run your program, pasted to a file test.pl, as ./test.pl on my system (Debian Linux) I get:

      bash: ./test.pl: usr/bin/perl: bad interpreter: No such file or direct +ory

      If I run it as perl test.pl I get:

      Hello World!

      So, I wonder what system you are running it on and how you are running it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-24 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found