From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

use strict;
use Function::Parameters { f => 'function' };
my $add = f ($x, $y) { $x + $y };
is $add->(2, 4), 6;
meth_b => 'method',
func_b => 'function',
};
func_b cat_b($x, $y) {
$x . $y
}
meth_b tac_b($x) {
$x . $self
}
is cat_b('ab', 'cde'), 'abcde';
is tac_b('ab', 'cde'), 'cdeab';
done_testing;