4 use Test::More tests => 3;
10 has foo => ( is => "rw" );
13 my ( $self, @args ) = @_;
14 return { @args % 2 ? ( foo => @args ) : @args };
18 is(Foo->new->foo, undef, "no value");
19 is(Foo->new("bar")->foo, "bar", "single arg");
20 is(Foo->new(foo => "bar")->foo, "bar", "twoargs");