in reply to How to pass blocks to subroutines
Is this what you were looking for? The prototype forces the block to be a code block. This works too...[nirvana:~] sporty% !vi vi t.pl sub x(&) { my $a = shift; my @b = (1,2); map &{$a}, @b; } x { print $_ };
sub x { my $a = shift; my @b = (1,2); map &{$a}, @b; } x sub { print $_ };
Bart: God, Schmod. I want my monkey-man.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to pass blocks to subroutines
by neniro (Priest) on Jun 12, 2004 at 16:25 UTC |