Bug in empty method of MooseX::AttributeHelpers::MethodProvider::List?
[email protected] (Tod Hagan)
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <[email protected]> |
All,
Shouldn't
sub empty : method {
my ($attr, $reader, $writer) = @_;
return sub {
scalar @{$reader->($_[0])} ? 1 : 0
};
}
instead say:
scalar @{$reader->($_[0])} ? 0 : 1
Running a simple test (attached) gives:
> mX_AH_CA_test
Count: 0
Empty returns: 0
Count: 5
Empty returns: 1
Also, I'm unfamiliar with the ': method' business after the subroutine
name, can someone explain?
Thanks.
Tod
--
Tod Hagan
Information Technologist
AIRMAP/Climate Change Research Center
Institute for the Study of Earth, Oceans, and Space
University of New Hampshire
Durham, NH 03824
Phone: 603-862-3116
test_mX_AH_CA
(application/x-perl, 703 B) - not displayed