But trinaries are so much more elegant than if/else statements.

Mark

-----Original Message-----
From: James Edward Gray II [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 29, 2004 12:33 PM
To: perl.org
Cc: Perl Beginners
Subject: Re: sort by extension


On Jul 29, 2004, at 11:23 AM, perl.org wrote:

> On Thu, 29 Jul 2004 12:08:20 -0400 (EDT), Jeff 'japhy' Pinyan wrote
>>
>> That's why he broke it down.  Is the map() really the problem, or is
>> it the regex, the ?: operator, and the two array references?
>
> All of the above ;), but now that I think about it the map looks 
> easiest, then
> ?: (which I also prefer not to use, along with unless).  At least map 
> is a
> word instead of a (cryptic) token.

Just for the sake of completeness.

COND ? TRUE CODE : FALSE CODE

is generally the same as

if (COND) { TRUE CODE; }
else { FALSE CODE; }

James


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to