There are lots of ways (this is Perl afterall), but would you want to? Assuming you 
still do....

One way...you could do an opendir, foreach the opendir calling stat, storing the 
information for which your are looking for each file, realizing that to sort the data 
by date you are probably going to need to make the date a main component of the 
structure, sort, then step through your strucutre only printing 5 records.

Or you could do, but then this would be cheating right?:

my @lines = `ls -ltr | tail -5`;
print @lines;

http://danconia.org

------------------------------------------------
On Wed, 27 Nov 2002 18:58:27 +0530, Mayank Ahuja <[EMAIL PROTECTED]> wrote:

> Hi all,
> 
> Please help me out with my beginners question:
> 
> Is there a way I can code an equivalent of `ls -ltr | tail -5` [on UNIX]
> in perl ?
> 
> Regards
> Mayank
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to