... 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: <%-(-(-(-<
In reply to Re^3: What does the short circuit || mean ?
by AnomalousMonk
in thread What does the short circuit || mean ?
by peterr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |