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


in reply to Perl & cron job environmental variables

You might like an explanation of what's happening here. By default, csh reads your .cshrc file, unless the -f switch is specified. That's why your environment is populated for the csh script but not for the Perl script. It's good practice in csh scripts to specify '#!/bin/csh -f' on the shebang line, to prevent reading .cshrc. It's better practice to avoid csh scripts altogether, see http://www.faqs.org/faqs/unix-faq/shell/csh-whynot for details.
  • Comment on Re: Perl & cron job environmental variables