Skip Menu |

This queue is for tickets about the Object-Nano CPAN distribution.

Report information
The Basics
Id: 76109
Status: new
Priority: 0/
Queue: Object-Nano

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.001
Fixed in: (no value)



Subject: Accessor when called to set a value, ignores certain values.
If Example::foo is an accessor generated by Object::Nano, then: my $obj = Example->new(foo => 2); $obj->foo(''); $obj->foo(0); $obj->foo(undef); $obj->foo('0'); say $obj->foo; # says 2 Basically Object::Nano ignores any value that Perl treats as false. Other modules that generate accessors, such as Moose, Object::Tiny::RW, etc, do not suffer from this problem. The trick is to replace this: if ($val) with this: if (@_ == 2)