in reply to Re: Calling a subroutine from a scalar
in thread Calling a subroutine from a scalar
It is perfectly reasonable to use a Perl package as a dispatch table. After all that's excatly what Perl's object implementation does.
Do you think...
...is really any better than...FOO->$bar();
... when you are not thinking in a OO way?no strict 'refs'; "FOO::$bar"->();
It should be noted that the security concern often leveled at symbolic CODE refs (that a malicious user could use a qualified name to access a subroutine outside the dispatch table) actually applies in the indirect class method call but does not apply in the explicit symref case.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Calling a subroutine from a scalar
by blazar (Canon) on Jul 01, 2005 at 09:03 UTC |