http://www.perlmonks.org?node_id=997956


in reply to Re: confused path
in thread confused path

In what case would $prog1 be different if one instance is run by system() and other by exec()?

Replies are listed 'Best First'.
Re^3: confused path
by choroba (Cardinal) on Oct 09, 2012 at 09:59 UTC
    I cannot imagine. But I cannot imagine how it were possible for which and exec, either.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      system("which $prog") would be passed through the shell. exec $prog would not be. The shell could run startup script which modify $PATH.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
        Indeed. That reminds me case of cron where $PATH may be restricted unless modified.