There's more than one way to do things | |
PerlMonks |
Re: use vs. require in string eval?by leriksen (Curate) |
on Mar 12, 2004 at 03:25 UTC ( [id://336071]=note: print w/replies, xml ) | Need Help?? |
Isn't the whole point that use happens at compile time and require happens at run time. You can only benchmark run time behaviour...
So your eval "use $object_class"; is effectively trying to benchmark nothing except the eval overhead itself - which in this case is efectively nothing. use is a declaration - require is a function - confusingly both are in the functions listed in chapter 3 of the camel book. I would thus suspect that eval "use $object_class"; is actually wrong. +++++++++++++++++
In Section
Seekers of Perl Wisdom
|
|