in reply to Is there an andand for Perl like there is in Ruby?
In
the say statement isn't conditional, as it is in the if form. So what is say supposed to do — that is, what is its argument supposed to be — when $shop->ShoppperDueDate is false?say $shop->ShopperDueDate->andand->day_name();
One technique you could consider — using $_ as a sort of alias for the value from some other expression (this is called a "topicalizer" in Perl 6 land):
But it's not entirely unugly.$_ and say $_->day_name for $shop->ShopperDueDate;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there an andand for Perl like there is in Ruby?
by bart (Canon) on Jan 08, 2009 at 09:01 UTC |