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

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Rethinking CPAN - http://shlom.in/rethinking-cpan

He says “One and one and one is three”.
Got to be good‐looking ’cause he’s so hard to see.
    — The Beatles, “Come Together”

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/


Reply via email to