>>>>> "SHC" == Shawn H Corey <[EMAIL PROTECTED]> writes:

  SHC> 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  } )->();

  SHC> And you wonder why I dislike dispatch tables?  So simple in
  SHC> concept, so ugly in reality.

s/dispatch tables/inheritance/g ;

:)

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to