Next | Program Repair Shop | 180 |
In Perl, you can pass a piece of code like this:
do_with_board(sub { ...do something...});
do_with_board gets a code reference argument:
my $code = shift;
It can execute the code like this:
$result = $code->();
# or $result = $code->($x, $y);
Next | Copyright © 2002 M. J. Dominus |