develooper Front page | perl.perl5.porters | Postings from June 2022

Re: Pre-RFC: add version numbers to errors/warnings containingpackage names

Thread Previous | Thread Next
From:
Tom Molesworth via perl5-porters
Date:
June 1, 2022 09:55
Subject:
Re: Pre-RFC: add version numbers to errors/warnings containingpackage names
Message ID:
CAGXhHdnn1OForZTXCn5tp5SGLeT7T7Q+g9mTeM7VyvNovJ5Frg@mail.gmail.com
On Wed, 1 Jun 2022 at 17:15, Ovid <curtis.poe@gmail.com> wrote:

> Anyone else have an opinion on this?
>
> On Sat, May 28, 2022 at 9:18 PM Darren Duncan <darren@darrenduncan.net>
> wrote:
>
>> ...
>> On 2022-05-28 4:16 a.m., Ovid wrote:
>> > Not sure what it would take to do this, but this kind of error crops up
>> a few times:
>> >
>> > Can't locate object method "some_method" via package "Some::Class"
>> >
>> > In my case, it turns out that some CPAN testers were using versions of
>> a
>> > Type::Tiny released eight years ago.
>> >
>> > It would be nice if the error looked like this:
>> >
>> > Can't locate object method "some_method" via package "Some::Class,
>> version 1.01"
>
>
This effectively means "call the ->VERSION method", which would seem to add
some complexity? side effects of the method, what if it throws an
exception, etc.

Just reading $VERSION could lead to different values than the "official"
class version... then again, the version may not match the distribution
version in the first place.

Aside from that, keeping the version *outside* the quoted string may help
reduce breakage for anything that's trying to parse the existing string.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About