- or download this
sub callback { sub { shift->( @_ ) } }
- or download this
sub callback {
my $coderef = shift;
...
my $yours = short_but_wrong( \&foo, 1, 2, 3 );
print "Mine: "; $mine->();
print "Yours: "; $yours->();
- or download this
X: 1 2 3
Undefined subroutine &main:: called at cback line 7.
- or download this
sub callback {
my ( $coderef, @args ) = @_;
sub { $coderef->( @args ) }
}