Ronen Kfir wrote:
>
> I need to delete oldest modified file in a directory. I find this file with this:
>
> my $oldest= printf "%s\n", (sort{ (-M $b) <=> (-M$a) } glob("v:\*"));
> print $oldest;
>
> unlink "$oldest";
>
> What I get in response is:
>
> oldest_filename
> 1
>
> File is not delet
I need to delete oldest modified file in a directory. I find this file with this:
my $oldest= printf "%s\n", (sort{ (-M $b) <=> (-M$a) } glob("v:\*"));
print $oldest;
unlink "$oldest";
What I get in response is:
oldest_filename
1
File is not deleted.
How would I do it?
?Ronen Kfir
System