in reply to Re^3: not able to make defined-or operator work in my code
in thread RE: not able to make defined-or operator work in my code

I don't see the OP assigning to %ENV. Are you able to get undefs from your environment? I'm genuinely curious, since I haven't yet been able to.

Replies are listed 'Best First'.
Re^5: not able to make defined-or operator work in my code
by lonewolf28 (Beadle) on Feb 11, 2015 at 01:43 UTC
    I have not included that in the code, however, when i do a export hi='' i'd expect the code to display 'undefined value' against the key hi.But it doesn't not sure why.

      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?