Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Batch file renaming - on identical name, keep only most recent file, based on dates

by Fletch (Bishop)
on Nov 05, 2019 at 14:33 UTC ( [id://11108327]=note: print w/replies, xml ) Need Help??


in reply to Re: Batch file renaming - on identical name, keep only most recent file, based on dates
in thread Batch file renaming - on identical name, keep only most recent file, based on dates

  • ALWAYS check the return value from open and show the error: open( ... ) or die qq{Problem opening '$ARGV[0]': $!\n};
  • If you'd use a hash like I suggested rather than an AoA it'd be more efficient; you're doing a linear search over all of your filenames repeatedly whereas a hash can just do exists

Those nitpicks aside, seeing as that's basically my suggestion above . . . looks sane. (Sanity not guaranteed. Contents may have settled during shipping. Prices may be higher in AK and HI.)

Edit: tweaked wording of second item slightly. Me no make sense much early morning do.

The cake is a lie.
The cake is a lie.
The cake is a lie.

  • Comment on Re^2: Batch file renaming - on identical name, keep only most recent file, based on dates
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108327]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found