"Chas. Owens" writes:
>> Or do I have to analyze each file with stat or something?
> snip
>
> In the end, someone has to stat each file, but you should be able to
> get what you want like this:
>
> my @files =
> map { $_->[1] }
> sort { $b->[0] <=> $a->[0] }
> map { -f $_ ? [-M _, $_]
Chas. Owens wrote:
Gunnar Hjalmarsson wrote:
Harry Putnam wrote:
I want to do something like this but with perl:
rm -f $(ls -lt|sed -n '6,$p')
so that the five newest files are always left.
Is there some short way to get that effect in perl?
Or do I have to analyze each file with stat or so
On Mon, Jan 12, 2009 at 17:41, Gunnar Hjalmarsson wrote:
> Harry Putnam wrote:
>>
>> I want to do something like this but with perl:
>>
>> rm -f $(ls -lt|sed -n '6,$p')
>>
>> so that the five newest files are always left.
>>
>> Is there some short way to get that effect in perl?
>>
>> Or do I have
Harry Putnam wrote:
I want to do something like this but with perl:
rm -f $(ls -lt|sed -n '6,$p')
so that the five newest files are always left.
Is there some short way to get that effect in perl?
Or do I have to analyze each file with stat or something?
Assuming that you are on a *nix plat
On Mon, Jan 12, 2009 at 16:59, Harry Putnam wrote:
> I want to do something like this but with perl:
>
> rm -f $(ls -lt|sed -n '6,$p')
>
> so that the five newest files are always left.
>
> Is there some short way to get that effect in perl?
>
> Or do I have to analyze each file with stat or somet
I want to do something like this but with perl:
rm -f $(ls -lt|sed -n '6,$p')
so that the five newest files are always left.
Is there some short way to get that effect in perl?
Or do I have to analyze each file with stat or something?
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org