I try to avoid using eval and code that can dies (exceptions being the exception). Why wasn't this written as something like
possibly with a Scalar::Util::reftype()?package DBM::Deep::Array; sub _get_self { ref $_[0] eq ARRAY ? tied( @{$_[0]} ) : $_[0] }
eval is reasonably expensive as it creates a new lexical scope and dieing and unwinding the stack is also expensive. Is there an advantage to using it rather than the code above? updated:silly benchmark added and removed!
In reply to Re: eval-blocks and Test::Builder
by fergal
in thread eval-blocks and Test::Builder
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |