in reply to Re: How to redefine a modules private function?
in thread How to redefine a modules private function?

Constant Functions says:

Calls made using & are never inlined.

I can't understand to what cases it applies to though.

bw, bliako

Replies are listed 'Best First'.
Re^3: How to redefine a modules private function?
by haukex (Archbishop) on Mar 08, 2022 at 16:10 UTC
    Calls made using & are never inlined. ... I can't understand to what cases it applies to though.

    In this case, this would require one to edit AnyEvent::DNS and change lines such as my $sa = AnyEvent::Socket::pack_sockaddr (DOMAIN_PORT, $server); to my $sa = AnyEvent::Socket::pack_sockaddr (&DOMAIN_PORT(), $server);.

Re^3: How to redefine a modules private function?
by LanX (Saint) on Mar 08, 2022 at 18:47 UTC
    > I can't understand to what cases it applies to though.

    &foo is disabling any prototype checks on foo calls at compile time. But constant folding requires an empty prototype () to rule out any side effects at run-time.

    (Though I never tried playing around with other side effects like returning a closure var)

    Like HaukeX said, this doesn't help here, because you'd need to patch the source.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery