Skip Menu |

This queue is for tickets about the Perl-Version CPAN distribution.

Report information
The Basics
Id: 63431
Status: rejected
Priority: 0/
Queue: Perl-Version

People
Owner: Nobody in particular
Requestors: blue [...] thisisnotmyrealemail.com
Cc:
AdminCc:

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



Subject: chaining methods (i.e. ->new($v)->method) behaves inconsistently
chaining some methods work okay: $ perl -Mstrict -Mwarnings -MPerl::Version -e 'print Perl::Version->new("1.03")->numify, "\n"' 1.003 others do not: $ perl -Mstrict -Mwarnings -MPerl::Version -e 'print Perl::Version->new("1.03")->inc_version, "\n"' Use of uninitialized value in print at -e line 1. $ perl -Mstrict -Mwarnings -MPerl::Version -e 'my $v=Perl::Version->new("1.03"); $v->inc_version;print $v, "\n"' 1.04
With the example you give, I think you misunderstand either the term "chaining methods" or the API for Perl::Version. numify doesn't return an object, it returns a string. inc_version also doesn't return an object. Neither of them allows what people usually mean by "chaining methods", which is something like $obj->foo->set_bar(1)->baz->set_quux(2)->blort. Also, there's nothing inconsistent about having some methods that return useful values and some that don't.