in reply to Re^2: What does the short circuit || mean ?
in thread What does the short circuit || mean ?

... if $part->contentType is undefined ...

This is a little tricky, but to be precise, you're saying "if $part->contentType is false", then do something. In Perl, falsity is represented by any of: undef (the undefined value), "" (the empty string), 0 (numeric zero), or '0' (a string consisting of a single 0 character). Use the  // operator to test specifically for defined-ness.

Update: See also True and False (aka Booleans).


Give a man a fish:  <%-(-(-(-<

Replies are listed 'Best First'.
Re^4: What does the short circuit || mean ?
by peterr (Scribe) on Mar 10, 2015 at 01:36 UTC
    Thanks AnomalousMonk, that is a great guide for understanding true or false.