in reply to Re^4: Looking for less code
in thread Looking for less code

Powerful poetry
undef JavaFan
Can't modify constant item in undef operator

:)

Replies are listed 'Best First'.
Re^6: Looking for less code
by Marshall (Canon) on Aug 11, 2009 at 09:49 UTC
    JavaFan, I was simply saying that using a Perl value that can't be printed as "false" is a bad idea when other options like =0 are also available.

    Perl is very tolerant of "undefs". That does not mean that they should be intentionally be used.

    "",'',0 are well defined "false" values in Perl. They can all be printed, they can all be passed to subs. "undef" means in the general sense: "undefined: I don't know". That is different than I know for sure that this is "false" instead of "true". Basically if you know that a $var is "false" you should set it to a known defined "false" value. undef is not the same thing.