in reply to Why I hate File::Find and how I (hope I) fixed it
Sorry for a very late reply to an old post.
I do not see how is
better than# create various wnated functions my $wanted= make_wanted( \&wanted_1, 'toto', 'tata'); find( $wanted, '.'); print "\n";
find( sub{ wanted_1( 'toto', 'tata')}, '.'); print "\n";
If you did want to play around I'd suggest something a bit different.
or even betteruse File::Find; sub callback (&) { my $sub = shift(); return sub { my @args = @_; return sub { $sub->(@args); } } } my $wanted = callback { my ($some, $params) = @_; print "wanted( $some, $params); \$_ = $_\n"; # ... }; find( $wanted->(1,2), 'd:\temp\copy'); find( $wanted->(20,19), 'd:\temp\copy');
How do you like this one?#... *wanted = callback { my ($some, $params) = @_; print "wanted( $some, $params); \$_ = $_\n"; # ... }; find( wanted(1,2), 'd:\temp\copy'); find( wanted(20,19), 'd:\temp\copy');
|
|---|