Vladi Belperchinov-Shabanski wrote:
On Fri, 23 Nov 2007 23:18:20 +0100
"A. Pagaltzis" <[EMAIL PROTECTED]> wrote:
* Jerrad Pierce <[EMAIL PROTECTED]> [2007-11-23 22:50]:
exists( $dispatch{$sub} ) ? $dispatch{$sub}->() :
warn "Key <$sub> does not exist in the dispatch table";
( $dispatch{$sub} || sub { warn "no such action '$sub'" } )->();
or &{ ... || ... }->()
just to avoid problems like:
print ( $dispatch{$sub} || sub { warn } )->();
And you wonder why I dislike dispatch tables? So simple in concept, so ugly in
reality.
--
Just my 0.00000002 million dollars worth,
Shawn
+------------\
| Shangri La \
| 40,000 km /
+------------/