IruP has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Do I need to use defined?
by hippo (Archbishop) on Sep 07, 2017 at 08:03 UTC
Re: Do I need to use defined?
by Anonymous Monk on Sep 07, 2017 at 05:41 UTC
    Yes. The second one will print when $test is 0, but the first one won't.
      can you describe why?

        Uh ... because 0 is defined.

        ...roboticus

        When your only tool is a hammer, all problems look like your thumb.

        In Perl, three things are false: the undefined value (undef), the empty string (''), and zero (0). Two of those things are defined.