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.
  • So this: ../JFDI/lib/JFDI/Web.pm: unless ($class->require) { will stop working in the future? About 40% of our internal code that uses UNIVERSAL::require is dying on failure. But that leaves 60% that isn't. And having something so simple change semantics out from under us is going to lead to pain. That makes me sad. Please do note that there's a lot of code out there that uses CPAN modules but isn't on CPAN itself. Maybe someday we'll get a sane module versioning system ;)
    • unless ($class->require) { will stop working in the future?

      That's the plan.

      Please do note that there's a lot of code out there that uses CPAN modules but isn't on CPAN itself.

      If you look at the Makefile.PL for UNIVERSAL::require [cpan.org] you'll notice logic in there which checks if the currently installed version of the module is older than the last API change. If so, it warns about the API change and sleeps for a moment so there's a hope of it being seen. Additionally, I'll put this warning in the version

      • But that still breaks existing code. What about having the "...and die" behaviour require a different "use UNIVERSAL::require" line?
        • by schwern (1528) on 2005.10.03 15:19 (#43672) Homepage Journal
          Already thought about this.
          package A;
           
          use UNIVERSAL::require;
           
          package B;
           
          use UNIVERSAL::require qw(die);
           
          package C;
           
          Some::Module::Which::Does::Not::Exist->require;
          What happens? Thus is the curse of UNIVERSAL. I also can't use a different package name, such as UNIVERSAL::use or UNIVERSAL::load, if its going to have a require() method because then UNIVERSAL::require and UNIVERSAL::use could not be used together in the same package.
          • because then UNIVERSAL::require and UNIVERSAL::use could not be used together in the same package.
            s/package/program/