in reply to Mail::Audit, sendmail, and Sys::Hostname: hostname fails in .forward

you can't really trust your path when running something that isn't an interactive shell. things like that typically don't read your /etc/profile, .profile, .bashrc, etc, so you are stuck with a default path the system gives you. of course, that should have /bin in it. you can always set your path at the beginning of your script:
$ENV{'PATH'} = "/bin:/usr/bin";
it's a little surprising that it actually got that far, i would expect it to get the hostname long before it resorts to running external commands, from POSIX::uname or one of the other methods it employs.
  • Comment on Re: Mail::Audit, sendmail, and Sys::Hostname: hostname fails in .forward
  • Download Code

Replies are listed 'Best First'.
Re(2): Mail::Audit, sendmail, and Sys::Hostname: hostname fails in .forward
by FoxtrotUniform (Prior) on Jun 20, 2002 at 21:02 UTC

    Tried setting the path in a BEGIN block, no change whatsoever in the script's behaviour. :-(

    --
    The hell with paco, vote for Erudil!
    :wq