develooper Front page | perl.fwp | Postings from November 2007

Re: fun with hashes!

Thread Previous | Thread Next
From:
A. Pagaltzis
Date:
November 23, 2007 15:56
Subject:
Re: fun with hashes!
Message ID:
20071123235549.GG20669@klangraum
* Mr. Shawn H. Corey <shawnhcorey@magma.ca> [2007-11-24 00:50]:
> my $sub = ( exists $dispatch{ $key } && ref( $dispatch{ $key } ) eq 'CODE' )
>          ? $dispatch{ $key }
>          : $dispatch{ 'default' };
>
> Just because you're not paranoid doesn't mean computers don't
> hate you :)

So why did you skip the check for whether the default value is
a CODE ref?

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About