in reply to Re: Re: Perl Environment Variable
in thread Perl CGI Environment Variable

Oh, sure it's working. The Perl program *is* getting the environment variable. However, the variable isn't set. Programs run from cron have hardly any environment variables set. And that makes sense. "HOME" is something associated with a user logged on. A program run from cron isn't started by a user - so there's no "HOME" environment variable.

You either need to set it explicitely yourself, or you should write your program in such a way you don't need the variable.

Abigail

Replies are listed 'Best First'.
Re: Re: Perl Environment Variable
by thor (Priest) on Jan 30, 2004 at 13:52 UTC
    I get around this by writing my crontab as such:
    0 0 * * * ssh yourhost yourscript
    You could also use rsh if you were so inclined. The [r|s]sh in to your local machine creates a login shell, thereby setting the environment to what one might expect.

    thor