Flip-flop. Flippity-flop goes my braine.
I've decided not to change the behavior of UNIVERSAL::require. Why?
1) Jesse's suggestion of using $@ instead of $UNIVERSAL::require::ERROR. It makes the error checking code much less disgusting to type.
2) The existing behavior has survived four years without anyone hating it enough to file a bug or patch.
3) Its such a simple module its not worth the turmoil.
I thought that would work anyway... (Score:2)
Could you still have an option to make it die? (Score:1)
Re:Could you still have an option to make it die? (Score:2)
1) People would write
$module->requirewithout realizing it wouldn't die on error.Well,
require_or_die()doesn't help with that. If they don't think$module->requiredoesn't die they'll probably never noticerequire_or_die().2)
$module->require or die $UNIVERSAL::require::ERRORis nasty.$module->require or die $@is nearly as short as$module->require_or_dieSo not really worth it.
Re:Could you still have an option to make it die? (Score:1)
How about an option when you use the module:
use UNIVERSAL::require qw/fatal/;
SomeModule->require; # blows up
?
Re:Could you still have an option to make it die? (Score:2)