ׁHi Manfred, On Mon, 23 Apr 2012 12:24:49 +0200 Manfred Lotz <manfred.l...@arcor.de> wrote:
> On Mon, 23 Apr 2012 11:01:33 +0300 > Shlomi Fish <shlo...@shlomifish.org> wrote: > > > Hi all, > > > > On Mon, 23 Apr 2012 10:12:33 +0300 > > Shlomi Fish <shlo...@shlomifish.org> wrote: > > > > > Hi Jack, > > > > > > On Mon, 23 Apr 2012 06:02:55 +0000 > > > Jack Maney <jma...@adknowledge.com> wrote: > > > > > > > Manfred, > > > > > > > > The issue is that you're storing the return value of the start > > > > method into $plf, and if you look at the source code, the start > > > > method returns 1. > > > > > > > > In fact, using Data::Dumper, > > > > > > > > print Dumper($plf) . "\n"; > > > > > > > > returns > > > > > > > > $VAR1 = 1; > > > > > > > > The start method is a method that doesn't return anything > > > > important, but manipulates things for other methods to use. What > > > > you want to do instead is set up the rules for $plf and then call > > > > the start method separately: > > > > > > > > use strict; > > > > use warnings; > > > > > > > > use Data::Dumper; > > > > > > > > use File::Find::Object::Rule ; > > > > > > > > my $plf = File::Find::Object::Rule->file->name("*.pl"); > > > > $plf->start("./"); > > > > > > > > while ( my $perl_file = $plf->match ){ > > > > print "$perl_file\n"; > > > > } > > > > > > > > > > > > If you're familiar with DBI, you can think of $plf as a statement > > > > handle, setting up the rules ('->file->name("*.pl")', etc) as > > > > analogous to DBI's prepare method, and start as analogous to > > > > execute. > > > > > > > > > > Thanks for helping Manfred! However, as he noted, the documentation > > > on https://metacpan.org/module/File::Find::Object::Rule is > > > misleading and ought to be corrected. Since I've originated > > > File::Find::Object::Rule (after forking it from the original > > > File::Find::Rule) and still maintain it, then I can do it now. So > > > thanks to Manfred as well for spotting this issue. > > > > > > > After looking at the code and documentation of File-Find-Rule, I > > realised this was a regression in the porting of its functionality to > > File-Find-Object-Rule, which wasn't caught due to lack of tests. This > > is now fixed (with a test) in File-Find-Object-Rule-0.0301, which was > > uploaded to CPAN a few minutes ago. > > > > Thanks again for reporting this problem. > > > > Regards, > > > > Shlomi Fish > > > > What can I say? Superb support from your side. > New version installed and tested with my small example, looks good. > Thanks for the compliment and thanks for upgrading. Always glad to help. My random signature quote is appropriate this time. Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ My Public Domain Photos - http://www.flickr.com/photos/shlomif/ To have bugs is human; to fix them — divine. Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/