Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • that you hadn't put it in UNIVERSAL::, but that's an entirely different issue.
    • If it wasn't in UNIVERSAL the module wouldn't work. The require method has to exist and be in a class' inheritence hierarchy *before* the class to be required is loaded.

      And this really is the sort of thing which should be universal.
      • It only has to be in UNIVERSAL because of the particular API you chose. It would be just as useful as something like this:

        Module::Loader->load($module_name);

        What bugs me about the current approach is that when I use a CPAN module that loads this, it magically adds require() methods to all of my classes, whether I want them or not.

        • It only has to be in UNIVERSAL because of the particular API you chose.

          Yep, but I can't exactly back out of that now. Remember, UNIVERSAL::require is an implementation of a Perl 6 RFC. People started using it. Go figure.

          What bugs me about the current approach is that when I use a CPAN module that loads this, it magically adds require() methods to all of my classes, whether I want them or not.

          require() is a special case. You're highly unlikely to create a method called "require" as its already a keyw