in reply to How to pass blocks to subroutines

[nirvana:~] sporty% !vi vi t.pl sub x(&) { my $a = shift; my @b = (1,2); map &{$a}, @b; } x { print $_ };
Is this what you were looking for? The prototype forces the block to be a code block. This works too...
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
    That's it (prototype)! Thank you very much.

    neniro