I made a test folder and in that folder I made a perl script that tries to call an executable in a bin folder that I also made.
So, in ./bin we see a script called “action”:
echo “RUNNING $1”
My script tries to call action and fails, then I add “./bin” to PATH and it finds it:
use Env qw(@PATH);
push @PATH, “./bin”;
That is one way to programmatically modify PATH