Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a very basic question... and this maybe because I'm not a Unix expert. I've the perl script in a path like '/usr/interfaces/scripts/' and am trying to invoke the script from a scheduler with the absolute command as '/usr/interfaces/scripts/perl <parameter>' but it gives me an error saying '/usr/interfaces/scripts/perl: not found'. Is there a nother way that I should be invoking this ? Thanks!

Replies are listed 'Best First'.
Re: invoking perl scripts....
by Mr. Muskrat (Canon) on May 01, 2002 at 17:05 UTC

    Do you have the shebang line at the top of your script?
    What's a shebang line you ask? It's how the shell knows what interpreter to use to run the script. It's a #! followed by the path to perl. #!/usr/bin/perl

    Try /usr/interfaces/scripts/ instead.
    And that failing then /usr/bin/perl /usr/interfaces/scripts/

    Matthew Musgrove
    Who says that programmers can't work in the Marketing Department?
    Or is that who says that Marketing people can't program?
      This sounds like your problem to me, too. I would only add to carefully check that shebang line. I can't tell you how many times I've typed: !#/usr/bin/perl -wor#!/usr/bin/prel -wor#!/bin/usr/perl -w One quick way tell if this isn't the problem is if you can invoke the script from the command line.

      Let us know if you still have problems.


      PS /usr/bin/perl should be replaced with whatever comes up when you type which perlat the command line.

      Here's what I get:

      $ which perl /usr/bin/perl
Re: invoking perl scripts....
by meraxes (Friar) on May 01, 2002 at 17:01 UTC

    You're trying to run a non existent perl binary. Put the path with the script:

    perl /usr/interfaces/scripts/


Re: invoking perl scripts....
by atopolc (Pilgrim) on May 01, 2002 at 18:48 UTC

    Your scheduler may not allow you to run a perl script with the directive in front,  perl /usr/interfaces/scripts/ scheduler doesn't

    You may be having a permissions issue with the scheduler. To fix this you will need to give the scheduler permission to run your script. This can be accomplished with the unix command chmod. I would do something like  chmod 750 /usr/interfaces/scripts/ Then just schedule your script to run directly as '/usr/interfaces/scripts/perl '