Mayank Ahuja wrote: > > Hi all, Hello,
> 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 ?
If you just want a list of the five newest files then:
my @files = ( sort { -M $a <=> -M $b } <*> )[ 0 .. 4 ];
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
