in reply to Automating dispatch tables
I would have written this as:
This automatically returns the package to the original package after the definition of the dispatch table.{ package dispatch; sub foo {} sub bar {} sub baz {} sub qux {} } if( my $ref = dispatch->can($method) ) { $ref->(); }
Liz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Automating dispatch tables
by BUU (Prior) on Apr 16, 2004 at 07:53 UTC |