in reply to Redefining function after fork
Yes. Here is one way:
... close CHILD; sub bar { my $bar = shift; print "modified foo($bar)\n"; } *foo = *bar; foo('child'); ...
Output:
12:39 >perl 844_SoPW.pl original foo(parent) modified foo(child) original foo(the end) 12:39 >
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Redefining function after fork
by gri6507 (Deacon) on Jan 18, 2014 at 17:44 UTC | |
by AnomalousMonk (Archbishop) on Jan 18, 2014 at 18:32 UTC | |
by gri6507 (Deacon) on Jan 18, 2014 at 18:46 UTC |