in reply to Re: Is there an andand for Perl like there is in Ruby?
in thread Is there an andand for Perl like there is in Ruby?
$_ and say $_->day_name for $shop->ShopperDueDate; But it's not entirely unugly.Indeed. But there is another way. A while ago, tye pointed me out that || (and friends), when the whole expression is in list context, return their RHS in list context too. So you can make this:
which will indeed skip the loop body if the LHS evaluates to false.say $_->day_name for $shop->ShopperDueDate || ();
|
|---|