Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: How to redefine a modules private function?

by bliako (Monsignor)
on Mar 08, 2022 at 15:36 UTC ( #11141917=note: print w/replies, xml ) Need Help??


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 (Sage) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11141917]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2022-09-30 06:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?