grep {BLOCK} list
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/perl use strict; use warnings; sub mysub(&;@); mysub { print @_ } (1..10); sub mysub(&;@){ my ($code,@list) = @_; $code->(@list); }