David Cantrell <[EMAIL PROTECTED]> writes:

> On Sun, Jan 20, 2002 at 04:23:46PM +0000, Greg McCarroll wrote:
>> * Dominic Mitchell ([EMAIL PROTECTED]) wrote:
>> > 
>> >     $foo ? do_foo_stuff() : do_other_stuff();
>> > 
>> 
>> Ok, this started off as a bit of a joke/troll, however i'm about to
>> take my own bait ....
>> 
>> For what its worth, i think this syntax is one of the worst pieces of
>> syntax in Perl.
>
> The really sick puppies (cough) are those who nest ?: inside each
> other.

I've seen it used as a 'switch' type operator:

   $cond1 ? action1() :
   $cond2 ? action2() :
   $cond3 ? action3() :
   ...
   $condN ? actionN();

and I'm still not sure whether I utterly hate it or not...

   $cond1 && action1() ||
   $cond2 && action2() ||
   ...

works just as 'well'...

-- 
Piers

   "It is a truth universally acknowledged that a language in
    possession of a rich syntax must be in need of a rewrite."
         -- Jane Austen?


Reply via email to