Call Perl Scripts from Other Dir in Linux, Path Messed Up

From: Public Interest (no_at_no.no)
Date: 10/29/03


Date: Wed, 29 Oct 2003 07:18:14 GMT

I put my Perl script in a unix shell now. The filename is abc.pl

If I run "perl abc.pl", it works perfect
but if I run "perl /abs-path/abc.pl", it gave me the error file now found in
abc.pl. I opened several files in abc.pl. I think the perl script abc.pl use
the path veriable on the shell not where abc.pl sites. Because I want my
script to be portable, so I don't wnat to change the relative path within
abc.pl, so how do I tell abc.pl to set default path?

Anoher problem is that I run several scripts at once, and I put them in a
.sh file as
perl 111.pl
perl 222.pl
perl 333.pl
and I made the .sh file chmod 777, but when I type the file name RUN.sh, it
still tells me "command not found". I am not sure it is a shell problem or I
set up something wrong here.



Relevant Pages

  • Preventing shell redirection from creating empty file
    ... I appologize that this is more of a shell question than a perl ... I have a c-routine that calls a perl script something like this: ...
    (perl.beginners)
  • Re: Command line fed to Perl was Re: File::Find again
    ... entered into a shell, such command line being passed to Perl. ... without going through a shell in order to run the Perl script. ...
    (perl.beginners)
  • RE: Segmentation Fault(Core dumped)
    ... But when I started testing my perl script, ... Compilation failed in require at ./test.pl line 13. ... > official business of Sender. ...
    (perl.dbi.users)
  • Re: Setting environment variables from a Perl script
    ... >> to set environment variables in Perl scripts and make them last even ... The environment variable changes stick! ... > variables in the shell from which you started your program. ... Perl script are no longer there), but there are times when a user ...
    (comp.lang.perl.misc)
  • Re: sharing variables-data perl-asp
    ... Also how do you invoke a perl script from an active server page? ... ASP in Perl. ... Why do you want to shell out to perl when you're already running perl? ...
    (comp.lang.perl.misc)