more useful options | |
PerlMonks |
Re^3: Perl script runs fine if exec'd from the directory, but gives error if run outside the directory.by marto (Cardinal) |
on Oct 02, 2020 at 08:27 UTC ( [id://11122473]=note: print w/replies, xml ) | Need Help?? |
"Also there's no $text variable in my script nor am I doing any substitution. Even if I embed the username and password in the script I still get the error." The error tells you exactly where this is coming from:
"What baffles me is the script works fine if I run it from the directory where its in. No errors whatsoever. Just when I run it with the path, the error comes up. " You have:
Consider the following example:
When run from the directory containing your config file:
When run from the parent directory:
As you see, the code can't find the config file.
Runs fine:
Update: IPC::Run3 needs Win32::ShellQuote because you are on Windows. https://metacpan.org/source/RJBS/IPC-Run3-0.048/Makefile.PL#L13.
In Section
Seekers of Perl Wisdom
|
|