I'm satisfied. The main reason for the report was to alert you to the
behavior. The error message is sufficiently obscure and dire that I
thought I'd triggered a bug in Perl, so down the rabbit hole I went.
Might I suggest a tweak to the docs to recommend turning off magic if
Object::Util isn't loaded with "use", with an example of the error
message? I should note that if the example code is run outside of a
BEGIN block, the error isn't fatal, just a complaint about an
undefined variable in B::Hooks::Parser.
Thanks,
Diab
On Fri, Jul 6, 2018 at 11:19 AM, Toby Inkster via RT
<bug-Object-Util@rt.cpan.org> wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=125750 >
>
> With magic, the import works a bit like this:
>
> Internals::SvREADONLY( my $_new = \&Object::Util::_new );
>
>
> Without magic, it works more like this:
>
> our $_new = \&Object::Util::_new;
>
>
> Your wrapper could theoretically still apply Internals::SvREADONLY to the variables after import if you wanted to.
>
>
> Are you satisfied with that as a solution? Otherwise, I'd need to delve into the guts of B::Hooks::Parser to attempt a fix, and there's no guarantee I'd be successful.