Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Return newest file

by chromatic (Archbishop)
on Aug 13, 2003 at 06:16 UTC ( [id://283464]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @list = `dir *.log \/B \/OD`;
    my $newest = $list[-1];
    print "$newest\n";
    
  2. or download this
    my @files = sort { -M $a <=> -M $b } <*.log>;
    my $newest = $files[-1];
    print "$newest\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://283464]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-18 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found