in reply to Dynamic inheritance
You don't particularly need the eval to set @ISA:
no strict 'refs'; @{ "${package}::ISA" } = $base;
Note also that string-eval is slow (the code needs to be compiled each time), so it's worth avoiding when you can; the Spawn() call can be simply:
.. or if you aren't using the eval() to protect against dying, even:$self = eval { $package->Spawn() };
$self = $package->Spawn();
Hugo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dynamic inheritance
by Prior Nacre V (Hermit) on Aug 06, 2004 at 14:14 UTC | |
by Anonymous Monk on Aug 06, 2004 at 20:54 UTC | |
by Prior Nacre V (Hermit) on Aug 06, 2004 at 21:15 UTC |