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

I cannot imagine. But I cannot imagine how it were possible for which and exec, either.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^4: confused path
by tobyink (Canon) on Oct 09, 2012 at 10:44 UTC

    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.