http://qs321.pair.com?node_id=1218134


in reply to Re: How to differentiate an empty array from an unitialized one?
in thread How to differentiate an empty array from an unitialized one?

Indeed, it would be incorrect for Perl to consider an uninitialized value to be an empty string, for much the same reason why, in SQL, NULL is not an empty string.
  • Comment on Re^2: How to differentiate an empty array from an unitialized one?

Replies are listed 'Best First'.
Re^3: How to differentiate an empty array from an unitialized one?
by haukex (Archbishop) on Jul 09, 2018 at 09:13 UTC
    it would be incorrect for Perl to consider an uninitialized value to be an empty string

    That is quite incorrect. Perl's undef (the default value for uninitialized scalars) evaluates to an empty string (or zero in numeric context). If warnings are enabled, this will usually warn, but only to indicate that the programmer may have made a mistake, not because it's inherently wrong.

Re^3: How to differentiate an empty array from an unitialized one?
by Anonymous Monk on Jul 09, 2018 at 08:07 UTC
    Perl does exactly that... The question isnt about arrays