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

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



In the context you're using it, it would never get set to 7, it would
always be undef.

-----Original Message-----
From: omaha-pm-bounces@pm.org [mailto:omaha-pm-bounces@pm.org] On Behalf
Of Jay Hannah
Sent: Friday, September 30, 2005 3:42 PM
To: Perl Mongers of Omaha, Nebraska USA
Subject: 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

_______________________________________________
Omaha-pm mailing list
Omaha-pm@pm.org
http://mail.pm.org/mailman/listinfo/omaha-pm