in reply to Why I hate File::Find and how I (hope I) fixed it
For an example with many of these closures running around in parallel, see Re (tilly) 1: 5x5 Puzzle. (Look specifically at ret_toggle_square.) And a more general form of your make_wanted function would be:
# Takes an anon function and a list of arguments. Returns # a closure which will call the anon function with those # arguments prepended to the argument list. sub bind_args { my ($sub, @args) = @_; return sub {$sub->(@args, @_);}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Generating similar functions in unrelated objects
by t'mo (Pilgrim) on Aug 31, 2001 at 02:03 UTC | |
by tilly (Archbishop) on Aug 31, 2001 at 07:25 UTC | |
by t'mo (Pilgrim) on Aug 31, 2001 at 16:37 UTC | |
by tilly (Archbishop) on Aug 31, 2001 at 17:54 UTC |