Re: fun with hashes!

"A. Pagaltzis" <[email protected]> Fri, 23 Nov 2007 23:18:20 +0100
Newsgroups gmane.comp.lang.perl.fun
Message-ID <20071123221820.GE20669@klangraum>
* 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'" } )->();

-- 
*AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1}
&Just->another->Perl->hack;
#Aristotle Pagaltzis // <http://plasmasturm.org/>