When you write \&increment( @_ ) you take a reference to the output of the increment sub, which already is a reference. And then, you don't return the result, so your do_something sub returns the result of the for statement, which is not what you expect.
You can correct your code by replacing \&increment( @_ ) with return increment(@_) (the & isn't actually useful here).
In reply to Re: Choosing between multiple closures
by Eily
in thread Choosing between multiple closures
by oakb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |