That's a truth test, not a defined-ness test or existence test. I think you want:if ($ENV{$val}) {
there, or else you'll be saying "undefined" for envars that are 0 or empty.if (defined $ENV{$val}) {
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to •Re^2: Setting values for undefined environment variables
by merlyn
in thread Setting values for undefined environment variables
by jacques
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |