On Friday, Nov 23rd 2007 at 14:53 -, quoth Jerrad Pierce:
=I admit I'm better with python these days than I am with perl, but one of
=the caveats that the dispatch table should be taught with is that
=selecting the correct code ref is different from calling through it.
=
=You might want to
AP == A Pagaltzis [EMAIL PROTECTED] writes:
AP * Jerrad Pierce [EMAIL PROTECTED] [2007-11-23 22:50]:
exists( $dispatch{$sub} ) ? $dispatch{$sub}-() :
warn Key $sub does not exist in the dispatch table;
AP ( $dispatch{$sub} || sub { warn no such action '$sub' } )-();
some
A. Pagaltzis wrote:
* Mr. Shawn H. Corey [EMAIL PROTECTED] [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 :)
Tied hashes a la Regexp::Common.
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
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
* Mr. Shawn H. Corey [EMAIL PROTECTED] [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
Steven W. Orr wrote:
On Friday, Nov 23rd 2007 at 14:53 -, quoth Jerrad Pierce:
=I admit I'm better with python these days than I am with perl, but one of
=the caveats that the dispatch table should be taught with is that
=selecting the correct code ref is different from calling through it.
on Friday, Nov 23rd 2007 at 13:12 -, quoth Uri Guttman:
=
=too long has this list been quiet. but i have a fun question. i am
=writing up slides for an all about hashes class. one goal i have is to
=list and explain as many different uses for hashes as reasonably
=possible. i have a short
Uri Guttman wrote:
too long has this list been quiet. but i have a fun question. i am
writing up slides for an all about hashes class. one goal i have is to
list and explain as many different uses for hashes as reasonably
possible. i have a short list to start with but i am sure the hive mind
of
On Fri, Nov 23, 2007 at 01:12:37PM -0500, Uri Guttman wrote:
isa
is a key valid? (not same as in a set). isa usually works on
fixed sets of keys
my @foos = qw( axxj djdj whwh ) ;
my %is_a_foo = map { $_ = 1 } @foos
I don't have
* 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
SW == Scott Wiersdorf [EMAIL PROTECTED] writes:
SW I don't have any additional uses for hashes to add, but I do have a
SW great hash initializer I picked up from Damian when he was in town a
SW few years ago (borrowing from your example):
SW my @foos = qw( axxj djdj whwh ) ;
SW my
Uri Guttman wrote:
AP == A Pagaltzis [EMAIL PROTECTED] writes:
AP * Jerrad Pierce [EMAIL PROTECTED] [2007-11-23 22:50]:
exists( $dispatch{$sub} ) ? $dispatch{$sub}-() :
warn Key $sub does not exist in the dispatch table;
AP ( $dispatch{$sub} || sub { warn no such action '$sub' }
14 matches
Mail list logo