[tpm] Is there a three-way version of...
linux at alteeve.com
Fri May 29 11:15:26 PDT 2009
Madison Kelly wrote:
> my $foo=$bar ? "bing" : "bang";
> I am probably trying to extend what the above syntax was designed to
> address, but I am curious. I've got three strings I want to show based
> on the viewing user's credentials. I know I can use:
> my $title="";
> if ($a)
> elsif ($b)
> But it's quite a bit more code.
> Thanks all!
Sorry to reply to my own question, but I did think of:
$title="bang" if $b;
$title="bing" if $a;
Though I would still be interested in another way more similar to:
my $foo=$bar ? "bing" : "bang";
More information about the toronto-pm