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

Sean Baker pbaker at omnihotels.com
Mon Oct 3 06:43:36 PDT 2005


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 at pm.org [mailto:omaha-pm-bounces at 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 at pm.org
http://mail.pm.org/mailman/listinfo/omaha-pm



More information about the Omaha-pm mailing list