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

do this with UNIVERSAL::require
which no one should ever do. It pollutes the UNIVERSAL class which means it affects every class and every object.

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Replies are listed 'Best First'.
Re^3: stronger than eval?
by mreece (Friar) on Sep 21, 2006 at 19:34 UTC
    i agree with the second sentence, but not the first. ;-)

      So having unrelated objects all get a method that they might not wish to have added to them is ok with you?

      ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

        if the method is called use or require, then yes, i am ok with that, even when it results in dying if you try $obj->use because you did not define your own use method on that class (which is what would typically happen anyway, except with a different error).

        the more exceptional case would be when you expected to handle use or require methods via AUTOLOAD, but i would never expect such so adding these methods to UNIVERSAL is ok with me.