in reply to Re: Redefining function after fork
in thread Redefining function after fork
However, this is not lexically correct. How does one create a subroutine whos name is a variable?foreach my $origName (qw(foo bar baz)) { my $newName = "modified_$origName"; sub $newName { print "modified $newName(" . join(',', @_) . ")\n"; } *$origName = *$newName; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Redefining function after fork
by AnomalousMonk (Archbishop) on Jan 18, 2014 at 18:32 UTC | |
by gri6507 (Deacon) on Jan 18, 2014 at 18:46 UTC |