But export hi='' is an empty string, and in Perl, there is a difference between an empty string and undef (the latter can be thought of as the absence of a value, kind of like NULL in other languages). Defined-or tests for undef, hence the above recommendation to test with length.
Did you try looking at %ENV with Data::Dump or Data::Dumper, as was recommended above?
In reply to Re^6: not able to make defined-or operator work in my code
by Anonymous Monk
in thread RE: not able to make defined-or operator work in my code
by lonewolf28
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |