develooper Front page | perl.perl5.porters | Postings from February 2018

Re: [perl #132788] Blead Breaks CPAN:LEMBARK/Object-Trampoline-1.42.tar.gz

Thread Previous | Thread Next
February 18, 2018 22:40
Re: [perl #132788] Blead Breaks CPAN:LEMBARK/Object-Trampoline-1.42.tar.gz
Message ID:
demerphq wrote:
>To fix that without loading I would have to more or less
>extract a nice chunk of the internals of into Carp.

It would be reasonable to load when a reference arg is seen,
in order to deal with that situation.  However, it doesn't need to load until that situation arises, and should not.  It shouldn't
impose the loading of on programs that don't make stack
traces.  There's a general principle in Carp of being minimal in what
it loads, because of its unique role and its ubiquity.

>Some  of them appear to be related to back-compat, but some of them are
>just egregious reimplementation of another modules functionality for the
>purpose of avoiding that module:

No, they're not.  The downgrade example isn't about whether the
module is loaded, because that's not how utf8::downgrade() gets defined.
utf8::downgrade() is defined by the core, regardless of the
module, on any Perl from 5.7.1 onwards.  The alternate implementation
exists for compatibility to Perl 5.6, which is still a consideration
for CPAN releases (though we're now on the tail end of that era).
The circumspectness about looking for utf8::downgrade() is to avoid
vivifying the unwanted utf8:: stash on 5.6.

The optionality of utf8::is_utf8() is likewise for 5.6 compat.
The optionality of B::svref_2object() *is* to avoid a dependency, but
it's not reimplemented if not available: the extra information that
it would have supplied is just omitted from a rare diagnostic message.
The optionality of overload::StrVal() is, as you noted, predicated on
the incorrect assumption that overloading only happens with
loaded: if that had been correct then it would mean that
wasn't required unless it was already loaded, so a dependency was

>                                               I plan to just use
> and break this expectation.

Don't just do that.  Be cautious; follow the precedent of minimising
module loading and avoiding stash vivification.  Carp is quite a subtle
module, in response to a unique set of constraints arising from its role
as the standard error-handling module.  Heavy-handed editing is likely
to do damage.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About