[tpm] Is there a three-way version of...

G. Matthew Rice matt at starnix.com
Fri May 29 13:01:01 PDT 2009


Madison Kelly <linux at alteeve.com> writes:
> > a table-like way is adviced.
> > my $title = $condition1 ? 'result1'
> >               : $condition2 ? 'result2'
> >               : $condition 3 ? 'result3'
> >              # ... more lines here

Yuch.  Looks like C :)

Mine looks similar to another one I saw:

    my $title = {aa => 'bing', bb => 'bang'}->{$key} || 'bong';

-- 
g. matthew rice <matt at starnix.com>      starnix care, toronto, ontario, ca
phone: 647.722.5301 x242                                  gpg id: EF9AAD20
http://www.starnix.com              professional linux services & products


More information about the toronto-pm mailing list