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.
  • Perhaps the failing test exposed a need to override UNIVERSAL::can()?

    • Can you give me some suggestions? In this case, CGI::header() is autoloaded. I could override UNIVERSAL::can() to try and call the method first to force the autoload, but what if the method has side effects? Regardless, I'll be calling it after the can_ok() function, so I think that's probably not a big deal, but I can see instances (e.g., with an autoloaded iterator), where this may not be optimal behavior. Offhand, I can't think of anything in CGI.pm where this would be a problem, though. Interesting

      • The simplest thing that could possibly work is to make a list of autoloaded methods and stick them into a hash. That turns can() into a hash lookup. From there, you're a bit limited on the available refactorings... you don't have a lot of good options to modify CGI.pm. That doesn't mean you can't take the first step, though.