in reply to Re^2: How to redefine a modules private function?
in thread How to redefine a modules private function?
You can avoid hitting the disk (even though that's great for debugging) by using an in-memory file in your @INC hook:
open my $out, \my $buffer or die "Couldn't patch AnyEvent::DNS; your Perl do +es not support in-memory filehandles"; while (<$in>) { s/sub\s+DOMAIN_PORT\b/sub DOMAIN_PORT () { 1053 } +sub FORMER_DOMAIN_PORT/; $buffer .= $_; } return $out;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: How to redefine a modules private function?
by salva (Canon) on Mar 09, 2022 at 11:24 UTC | |
by haukex (Archbishop) on Mar 09, 2022 at 13:30 UTC | |
by LanX (Saint) on Mar 09, 2022 at 15:34 UTC |