Mark Jason Dominus <mjd@plover.com> writes: > hv@crypt.org: > > Gisle Aas <gisle@ActiveState.com> wrote: > > :Another option is simply to pass a closure that capture the arguments > > :you want your callback to receive. > > :But again, I think File::Find is fine as it is. > > > > I agree, > > > It's not always convenient to do that. The sub{} wrapper will seldom be much more typing than providing args any another way, so I don't find it very inconvenient either. The Tk-style for providing callback args actually do save a little bit of typing: find([\&foo, $bar], @files); find(sub { foo($bar) }, @files); > I have wondered for a long time why File::Find didn't have this > feature. Have anybody ever done a survey of which Perl callback APIs provide args to be passed back and which do not? I certainly tend to not provide a way to pass args that as closures gives enough hooks as it is. Regards, GisleThread Previous | Thread Next