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

I recommend taking some 'C' classes and you will understand the difference between "undef" and "zero".
Unlike C, in Perl, "undef" is actually a value. I really fail what insight C can give you here. In fact, I recommend you take some Perl classes, and learn what undef really is (and isn't).

Replies are listed 'Best First'.
Re^5: Looking for less code
by Anonymous Monk on Aug 11, 2009 at 09:28 UTC
    Powerful poetry
    undef JavaFan
    Can't modify constant item in undef operator

    :)

      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.