The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more
12345678910111213141516171819 #!perluse strict;use warnings FATAL => 'all';use Test::More;{ package Foo; use Function::Parameters qw(:strict); method new($class:) { bless {}, $class } method bar (:$baz = 42) { $baz }}my $o = Foo->new;is($o->bar, 42);is($o->bar(baz => 0xaffe), 0xaffe);done_testing;
#!perl
use
strict;
warnings
FATAL
=>
'all'
;
Test::More;
{
package
Foo;
Function::Parameters
qw(:strict)
method new(
$class
:) {
bless
{},
}
method bar (:
$baz
= 42) {
my
$o
= Foo->new;
is(
->bar, 42);
->bar(
baz
=> 0xaffe), 0xaffe);
done_testing;