Nov 18, 2017, 3:01 PM
Post #9 of 17
Re: [tester_V] delete the newest file from the list
[In reply to]
I tried to use Laurent_R code but it fails on line 3 for "use feature "say"; so I removed it.
I replaced "say" with print "@sorted \n " ; and the code really sorts the list.
It just prins everything on the same line and the " \n " did not work somehow.
Yeah, I did not know you were stuck with such an old version of Perl. "say" was introduced with version 5.10 (which came out in 2009).
print "$_\n" for @sorted;
I also wanted to remove the newest file from the list that was a major headache for me.The pop function, used on the @sorted array, will return the last item of the array (newest file) and remove it from the array.
Update: you completely changed your post after I responded to it. My answers now look weird and unrelated to your post.
Update 2: Oh, no, it is actually a new post that you posted. Sorry, our posts sort of crossed each other.
(This post was edited by Laurent_R on Nov 18, 2017, 3:23 PM)