Re: fun with hashes!
[email protected] ("A. Pagaltzis") Fri, 23 Nov 2007 23:18:20 +0100
| Newsgroups | perl.fwp |
|---|---|
| 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/>