Now that we have a recursive iterator, how about a visitor? #29

Closed
dagolden opened this Issue Mar 27, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@ghost

ghost commented Mar 27, 2013

Instead of this:

my $next = $path->iterator({recurse => 1});
while ( my $file = $next->() ) {
    process_file($file);
}

How about this:

$path->visit(\&process_file, {recurse => 1});

It's trivial to code and would be fairly useful for someone who doesn't need/want to deal with a file iterator like File::Next or Path::Iterator::Rule

keedi added a commit to keedi/Path-Tiny that referenced this issue Feb 9, 2015

Add 'visit' method
This adds a visitor similar to ->iterator(...).

Fixes #29

@ghost ghost closed this in 8bd2650 Mar 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment