in reply to Re^5: Monkey patching all subs with a basic 'starting subname' message
in thread Monkey patching all subs with a basic 'starting subname' message
I thought the first case was a closure variable. i.e.
The thing is, I can only see how I might get the output of prototype into the string and not the closure. i.e.
my $original_proto = prototype("${package}::${sub_name}"); my $original_sub = \${"${package}::${sub_name}"}; *{"${package}::${sub_name}"} = sub HOW_DO_I_GET_$original_proto_IN_HER +E? { return $original_sub->(@_); };
my $original_proto = prototype("${package}::${sub_name}"); my $original_sub = \${"${package}::${sub_name}"}; *{"${package}::${sub_name}"} = eval qq{sub $original_proto { return \$ +original_sub->(\@_); } };
Am I missing something obvious?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Monkey patching all subs with a basic 'starting subname' message (trace perldebugger)
by LanX (Saint) on Jul 18, 2017 at 13:44 UTC | |
by Anonymous Monk on Jul 19, 2017 at 13:04 UTC | |
|
Re^7: Monkey patching all subs with a basic 'starting subname' message
by Corion (Patriarch) on Jul 25, 2017 at 12:05 UTC |