Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: How to differentiate an empty array from an unitialized one?

by Anonymous Monk
on Jul 09, 2018 at 03:57 UTC ( #1218134=note: print w/replies, xml ) Need Help??


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 (Canon) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1218134]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2019-04-20 14:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I am most likely to install a new module from CPAN if:
















    Results (110 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!