Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: use: command not found error

by shigetsu (Hermit)
on May 03, 2007 at 20:08 UTC ( [id://613470]=note: print w/replies, xml ) Need Help??


in reply to use: command not found error

My guess at first sight of your description is that the shebang line - the line that points to the interpreter (on unixy systems most often: #!/usr/bin/perl) is either missing, wrong in its syntax, does not point to an existing Perl interpreter or has been misplaced (not as first line).

Perhaps some more code would help us to properly diagnose the problem? Be sure to enclose your code in <code></code> tags.

Replies are listed 'Best First'.
Re^2: use: command not found error
by kushtun (Initiate) on May 04, 2007 at 18:15 UTC
    One route on unix systems for the "where is this user's perl?" is to use:
    #!/usr/bin/env perl
    which gets whatever the user would get by typing "perl" at the command line. There may be multiple perl versions in different locations, leading to strange behavior. If /usr/bin/env is not there, there are bigger problems.
      which gets whatever the user would get by typing "perl" at the command line. There may be multiple perl versions in different locations, leading to strange behavior. If /usr/bin/env is not there, there are bigger problems.

      Indeed this is often debated, and many think that env suffers from the same problem it aims at solving.

        i have the same problem - i want to run the following perl script helloworld.pl #!/usr/bin/perl print "Hello World!\n"; it runs if i type perl helloworld.pl in the command line but, if i try to run the script without calling perl explicitly in the command line (i.e. helloworld), i get "command not found". i'm absolutely sure that i'm running the program from the correct path and that perl is located in /usr/bin/ - i used which perl. what's going on guys?
Re^2: use: command not found error
by Anonymous Monk on Oct 02, 2009 at 01:26 UTC
    This post worked for me from the standpoint that my shebang line was not the first line. Oh the details!!!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-16 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found