How to set the script execution directory?
For example, the script main.pl
is located in a scripts/
directory. The file to be processed is data.txt
, located in a data/
directory.
Then, cd data/
and invoke the script using ../scripts/main.pl -i data.txt
When debugging the script in Padre debugger, the execution directory is the script's location scripts/
. The command args -i data.txt
can be set through the Preferences dialog, but in order for this to work, it needs to be changed to -i ../data/data.txt
How can one set the execution directory ti be other than the script's location?
How can one set the execution directory to be other than the script's location?
According to the comments, you seem to be running Padre version 0.94 for Windows, then apparently it is not possible to set the directory (at least from the GUI).
However, the feature seems to have been added to Padre later. I installed Padre version 1.00 on my Ubuntu 18.10 laptop running Perl 5.29.8 (with thread support). Then there is an option "Run in directory" from the "Debug launch Parameters" dialog where you can set the script execution directory.