http://qs1969.pair.com?node_id=650981


in reply to hash undef?

 if (exists $time{$recordNumber}) This will tell you if it actually exists rather than whether it holds an undef or not. Defined will return false if the value contains an undef or if it just doesnt exist.

Update: Thank you Mr. Anony. I had said that Defined returns undef, which isnt accurate and even contradicts the use of the function.

Replies are listed 'Best First'.
Re^2: hash undef?
by Anonymous Monk on Nov 15, 2007 at 15:11 UTC
    defined returns a boolean false (an empty string), not undef, if the value it is testing is not defined:

    perl -wMstrict -e "print 'defined returns defined' if defined defined undef" defined returns defined