in reply to Re^2: confused pathin thread confused path
system("which $prog") would be passed through the shell. exec $prog would not be. The shell could run startup script which modify $PATH.