NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Keep File::Find...and (Score:1)
Why not create a wrapper module with better interface? That way you can keep it...and make it "better". Seems it isn't going away anyway.
Re: (Score:1)
For the same reason that Buffy Summers stakes vampires instead of giving them nice suits and $50 and sending them to charm school. Sometimes dangerous things are better off really dead.
At some point, you have to pay off the technical debt of backwards compatibility [modernperlbooks.com], at least if you have any hope of maintaining the project.
Re: (Score:2)
Re:Keep File::Find...and (Score:2)
Inspired by your post, I'd like to make a post to my technical journal [livejournal.com] (with the "perl" tag which should put it on Perlsphere), called "The Case for File-Find-Object". I'll give several use cases for tasks you can achieve with F-F-O that you cannot achieve easily with File::Find.
Here's a sneak preview:
1. Aborting from scanning a huge directory tree once you found the single or a few desired result. (See also this question on stackoverflow [stackoverflow.com]). Very painful and hacky with File::Find, but trivial with F-F-O's iterative interface.
2. Implementing something like diff -r (recursive diff) in Perl. In F-F-O you can instantiate two different traversers to the two directories and gradually iterate one file at a time. Using File::Find you'll need to collect all the results from the two directory structures into two arrays, sort them both, and then walk over the arrays.
I don't have any ideas for more use cases, but I'm always open to suggestions. And using File-Find-Object all of your code can be written using method calls instead of setting global variables and other brain-damage.
Reply to This
Parent