Skip Menu |

This queue is for tickets about the File-Find-Rule CPAN distribution.

Report information
The Basics
Id: 46599
Status: resolved
Priority: 0/
Queue: File-Find-Rule

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: error from nested or(), or(), exec()
Date: Tue, 02 Jun 2009 08:52:05 +1000
To: bug-File-Find-Rule [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
With File-Find-Rule 0.30 and recent debian i386 perl 5.10.0, the program foo.pl below the program foo.pl below perl foo.pl gets an error Can't use string ("") as a subroutine ref while "strict refs" in use at (eval 46) line 25. where I hoped it would print the names of the files under /tmp. It probably depends on /tmp being not empty to get the problem, so if it seems to succeed try in('/') instead. The $exec or $or rules alone run fine, but the $or_or nested "or" fails. I noticed this with the "perlver" program from Perl::MinimumVersion. It makes an ->any() of a File::File::Rule::Perl ->perl_file(), the latter being an ->or() of an ->exec().
use strict; use warnings; use File::Find::Rule; sub callback { print "callback\n"; return 1; } my $exec = File::Find::Rule->exec (\&callback); my $or = File::Find::Rule->or ($exec); my $or_or = File::Find::Rule->or ($or); print $or_or->in('/tmp');
Thanks for the report, it's fixed in VCS[1] and should be released in the next couple of days with any other bugs I can easily fix. -- Richard Clamp <richardc@unixbeard.net> [1] http://github.com/richardc/perl-file-find-rule/commit/cbbe03096e1677178afe060ab2f4c82ce40e7983