Stories
Slash Boxes
Comments
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • 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.

    • Why not create a wrapper module with better interface?

      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.

      • Can you come up with an actual reason instead of a poor analogy? Unlike fictional vampires, File::Find only harms those who choose to be harmed by using it directly. File::Find is more like a big fried breakfast with all that nasty fat and EVIL meat, and we have a technical term for people who say breakfast should be banned. That term is "idiot".
        • 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.