Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Return newest file

by snax (Hermit)
on Aug 13, 2003 at 16:29 UTC ( [id://283682]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Return newest file
in thread Return newest file

Why torture yourself to grab the last element when you can reverse the sort and grab the first? It strikes me as being semantically clearer as well:
$newest = (sort { -M $a <=> -M $b } <*.log>)[0];
Same story with the Schwartz trick.

Of course, TIMTOWTDI :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://283682]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.