in reply to Re^2: 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

If thats the diagnostical thinking, Basic debugging checklist,
$ perl -e"use Data::Dump qw/ dd /; %ENV = (hi =>undef ); dd( \%ENV ); { HI => undef }

Replies are listed 'Best First'.
Re^4: not able to make defined-or operator work in my code
by Anonymous Monk on Feb 11, 2015 at 01:33 UTC

    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.

      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?