From: Uri Guttman <[EMAIL PROTECTED]>
   Date: 24 Jul 2002 23:48:47 -0400

   <untested>

   $func = *{$Quizzer::Attempt::{$name}}{CODE} and return $func->($self) ;

Works if $name is in the package, fails if not:
Can't use an undefined value as a symbol reference at -e line 1.

     KG> --kag (who is overly fond of dispatch tables)

   so why not use your own instead of messing with typeglobs? with globs
   you have to deal with an extra level to get the code part. with your own
   table you know the value is a code ref and the whole thing is simpler
   and cleaner.

Sometimes I do.  For this project, I wanted the functions to be in
the package for other reasons, and it seemed a waste of time to write
out a hash containing all of the coderefs when the package stash is
already there.

--kag

Reply via email to