in reply to Re^2: confused path
in thread confused path

Please post the values of $dir & $prog. Given those values, tell us where the command to be executed lives.

(Nonetheless I will venture into mind reading) By the clue of $Script - basename of script ..., try executing the command with path prefixed as in ...

... $prog = join '/' , $dir , $prog; exec( $prog , ... );