RE: sort by extension

From: Mark A Galbreath (GalbreathMA_at_state.gov)
Date: 07/29/04


To: "'perl.org'" <perl.org@jpw3.com>
Date: Thu, 29 Jul 2004 12:34:44 -0400

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

Mark

-----Original Message-----
From: James Edward Gray II [mailto:james@grayproductions.net]
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: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Relevant Pages

  • Re: sort by extension
    ... >> That's why he broke it down. ... Is the map() really the problem, ... TRUE CODE: FALSE CODE ... James ...
    (perl.beginners)
  • Re: sort by extension
    ... Not a "fan" of map() and grep() or just don't understand them? ... looks for an extension and returns a two element array ... modified list of originals and extensions side-by-side is then handed ...
    (perl.beginners)
  • Re: Putney Green
    ... > The Bakerloo line station at Warwick Avenue used to (I think it's been ... > extension in south London. ... Liverpool Street already open as far as Mile End. ... or page 32 of "Mr Beck's Underground Map". ...
    (uk.transport.london)
  • Re: Uploaded document security in ASP.net
    ... I'd say you'd probably want to restrict the types of files to be uploaded, ... you could map all extensions to ASP.NET ... be viewed by the users unless i regsiter their extension with IIS. ... my asp.net page lets the users uploads documents up to a folder on the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: teminology
    ... to extend "naturally" to a set B which contains as a proper subset ... It means the "obvious" extension. ... way that a map defined on A has an extension which is, ... B can be an inner product space, A a dense linear subspace, and ...
    (sci.math)