in reply to Re^5: stronger than eval?
in thread stronger than eval?

I have to agree with diotalevi on this: there is no good reason for this to be done through UNIVERSAL::. It's just a simple utility method. It does not need to be added to every namespace automatically.

Replies are listed 'Best First'.
Re^7: stronger than eval?
by ikegami (Patriarch) on Sep 21, 2006 at 21:57 UTC

    I agree too. For example,

    use UNIVERSAL::require (); Cache::File->use() or print "error: $@";

    could be written as

    use Module::Loader qw( load ); load Cache::File or print "error: $@";

    Just as readable. Just as simple. No polution of UNIVERSAL::. And with the right prototype, load's argument doesn't even need to be quoted.

    Update: The module I made up above already exists as Module::Load!
    Update: Module::Load dies instead of returning false.