Slash Boxes
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.
More | Login | Reply
Loading... please wait.
  • Have you considered applying this directly to objects? Use Symbol::gensym to get a new package, make the object ISA the new class. Potentially you have to rebless the object higher or something. I'm guessing chromatic and Ovid did something similar with Class::Trait.
    • That's possible. Another way is simply:

          my $obj = $pkg->new();

      The instance keeps the overload, but subsequent instantiations are not affected. The only downside to that approach is that it might blow away any deref overloads that may exist in $pkg. But that's a pretty small hazard.