[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Ow!! || bit me




On Sep 30, 2005, at 2:38 PM, Kenneth Thompson wrote:
Wouldn't this work?

$res->set_child_qty($cookie->{child_qty} || $q->param('child_qty') || 0);

Since it ignores the falses (0 and undef), it would fall through to the
last choice, which would be your default?

As discussed: Yes, but it wouldn't Do The Right Thing (set_child_qty(0)) if $cookie->{child_qty} was 0 and $q->param('child_qty') was 7.

It would set_child_qty(7). The Wrong Thing. -grin-

j