What happened to File::Find::Rule?

jdavidb on 2009-02-16T19:40:45

What happened to File::Find::Rule? It apparently hasn't been updated since 2006. Once upon a time, it was the hottest module on CPAN.

Is it still a good idea to use this instead of File::Find/find2perl? Have I got the right module?


Use FIle::Next

petdance on 2009-02-16T22:47:06

I far prefer File::Next's iterator approach, which is why I wrote it. :-) I find it makes more sense to just make a little filter callback rather than front-load all these rules like in F:F:R.

It's all adapted from MJD's iterators in Higher Order Perl. ack is based on it.

Stable

acme on 2009-02-17T03:42:42

File::Find::Rule is stable and perfect. It's just a wrapper around File::Find which doesn't make you have to worry about callbacks.

Re:Stable

richardc on 2009-02-17T09:48:34

Perfect might be a step too far, but as nobody's been screaming out at me that it's become broken, I'm going to have to go with 'it's done'.

Re:Stable

Shlomi Fish on 2009-02-18T16:17:54

Well, you still need to take care of the bugs in RT (i.e: fix them or close them) or people may conclude, like J. David did., that F-F-R is abandoned. While you're in the neighbourhood, you may wish to deal with the Kwalitee problems.

Re:Stable

richardc on 2009-02-18T16:35:11

Hm, see I thought my positions on rt.cpan.org and Kwalitee were known at this point. I don't play either game.

I deal with bugs that are mailed to me using the contact details in the AUTHOR block. If I want to use an rt queue then I can point people at it in the documentation, but you can see I haven't. That one automatically exists doesn't make it any more appealing to me, though I am grateful that the facility exists for people who do find it useful.

As to Kwalitee, I don't have the time in the day to game that system. I also don't feel that it has any direct effect on the fitness of the code, but that's a different argument.

I'm trying to be an active module author here, but when I have to cruise comments on blog posts to find out that people want me to change my code, something somewhere broke.

Re:Stable

Shlomi Fish on 2009-02-18T18:17:29

The CPANTS kwalitee is not very important, I just mentioned it in the same breath. However, if you don't want people to use rt.cpan.org, then you can use a META.yml field to point them to the right URL for the correct bug tracker. (See Ack's META.yml for an example). This URL may as well be a page on your homepage (or on a wiki) that says "Email me your bugs.". And you should close the bugs there with a nice comment saying "Please email them to me". (After you've done the META.yml change).

Consider File::Finder

merlyn on 2009-02-17T04:08:07

I've always found File::Finder more intuitive. But that's because I wrote it. :)

Re:Consider File::Finder

jplindstrom on 2009-02-17T17:16:17

Well, it not installing on Windows (due to http://rt.cpan.org/Public/Bug/Display.html?id=13993) is a blocker for me (even if I'm developing on a Unix) when there are perfectly fine options that are cross platform and won't cause problems for anyone else.

Stability

jns on 2009-02-17T09:51:13

I don't have a competing module to hype up, but I'm not sure exactly what is wrong with "hasn't been updated since 2006" - if it doesn't have any bugs and works with the latest versions of perl and the modules on which it depends then I can't see any reason which it should have been updated. Infact I would say this is a good thing - the author made a well designed, bug free module in the first place.

Re:Stability

djberg96 on 2009-02-17T18:38:15

I see 5 open bugs and 1 feature request. One of the bugs is 2 years old.

http://rt.cpan.org/Public/Dist/Display.html?Name=File-Find-Rule

may we all live in *un*interesting times

nicholas on 2009-02-17T09:54:48

It apparently hasn't been updated since 2006.

Wasn't that a comment made of one of MJD's modules too? Maybe not for that particular year. But it too was about a module that works nicely, doesn't need feature creep, or new an unexpected surprises.

I like to turn "change is inevitable, progress is not" around, and think about the amount of progress any particular change gives. To me it implies that not all change is worth it.

Just Works

vek on 2009-02-17T14:42:24

I use F::F::R all the time. Please don't fall into the trap of assuming that just because it hasn't been updated in a couple of years, it should be avoided.

Try it out. Let us know how it worked out for you.

FFR is still the best searching module

Alias on 2009-02-17T23:31:55

... mainly because of the complexity of plugins you can write for it.

File::Find::Rule::Perl

File::Find::Rule::PPI

File::Find::Rule::VCS

(And soon)

File::Find::Rule::NoIndex

File-Find-Object-Rule

Shlomi Fish on 2009-02-18T16:31:37

Inspired by this discussion and the recent inter-blog discussion about File::Find I decided to unleash File-Find-Object-Rule, which I've been working on for some time, to the CPAN today after a small amount of cleanup. (I hope the link works by the time you read it, if not see the svn trunk on Berlios.)

File-Find-Object-Rule is a fork of File-Find-Rule that was adapted to use File-Find-Object instead of File::Find. Read the link for why File-Find-Object is superior to File::Find. There are still some anachronisms in the first version I released (0.0100), but I hope to fix them soonish.

File::Find

bart on 2009-02-23T07:56:51

While everybody's hyping up their own favourite File::Find replacement, I just want to chime in and say that, for a lot of the replacement modules, I just like File::Find better. In particular, File::find::Rule, which I find just incomprehensible, and horrible.

I wonder if many of the "problems" people see for File::Find are actually problems. So it uses global variables as fake parameters... but they're dynamically limited in scope to (the immediate surroundings of) the callback sub. So I don't mind ist so much. The situation is actually very much alike to the keyword this in plenty of OO languages. Besides, File::Next does the same. :)

But you do have to do it the proper way: use an anonymous sub, not a reference to a global function. That way, you end up with a closure, instead of something that depends on global variables (not File::Find's own global variables, but yours).

Do

use Cwd;
sub traverse {
    my @files;
    find sub {
        push @files, $File::Find::name if /.txt$/ and -f;
    }, cwd;
    return @files;
}

Not

use Cwd;
sub wanted {
    push @files, $File::Find::name if /.txt$/ and -f;
}
@files = ();
find \&wanted, cwd;

Re:File::Find

Aristotle on 2009-02-23T10:41:09

The point is, push @files, $File::Find::name is what everyone does. So at best it’s unnecessary noise and the module should do that automatically.

However, the reason everyone does that is because performing complex work from within a callback is a pain. State machines are no fun to write. An iterator interface is much nicer to work with when you have something complex to do, and just as easy to use when you really just want to collect the file names. It’s much friendlier to use in programs that run code out of an event loop, too (goes back to not having to write a state machine).