in reply to Where to save perl scripts on a mac?

Assuming you're running a bash or bashlike or some such, it will search $PATH for the program you are attempting to run. Note that perl it self won't search $PATH, so saying "perl foo.pl" will always try to execute foo.pl in the current directory. The solution is to use the appropiate shebang at the top of your script and to set it executable, so bash can execute it from anywhere in your $PATH.
  • Comment on Re: Where to save perl scripts on a mac?

Replies are listed 'Best First'.
Re^2: Where to save perl scripts on a mac?
by PodMaster (Abbot) on Jun 28, 2005 at 05:45 UTC
    Note that perl it self won't search $PATH, so saying "perl foo.pl" will always try to execute foo.pl in the current directory.
    Which is why you should use the -S switch ("perl -S foo.pl"), to tell perl to search $PATH :)

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Well, I didn't know about the -S switch, but it's still clumsy to have to type perl -S in front of everything.
A reply falls below the community's threshold of quality. You may see it by logging in.