in reply to Re: File::Find considered hard?
in thread File::Find considered hard?

I guess you are right it would be best if File::Find supported both types of interfaces, functional and iterative.

There is no currying going on in here though. The find() is a higher order function, but it is not curried. If it was it would allow you to pass it just the wanted() function and get a function "find_and_do_something()":

my $delete_tmp = find(sub {unlink($_) if -f and /\.tmp$/i}); ... $delete_tmp->($one_directory); ... $delete_tmp->($other_directory); ..

Jenda
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
   -- Rick Osborne

Edit by castaway: Closed small tag in signature

Replies are listed 'Best First'.
Re: Re: Re: File::Find considered hard?
by etcshadow (Priest) on Mar 16, 2004 at 20:58 UTC
    The find() is a higher order function, but it is not curried.
    Right... I meant that the "wanted" function is (at least frequently) curried, or at least a closure.
    ------------ :Wq Not an editor command: Wq