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.
  • Out of curiousity, what was SUPER not doing for you? Theory once asked if it could dispatch to a given parent class (skipping one, for example), but I never added that.

    • I was trying to do this, very roughly:

      for my $field (@fields) {
        my $code = sub {
          my $self = shift;
          my $value = $self->super($self, @_);
          return $value if defined $value;
          $self->default_list->$field;
        }
        Sub::Install::install_sub({ code => $code, as => $field });
      }

      I don't remember the failure I experienced off hand, but I'll try writing it again today and see if it turns out to work.

      --
      rjbs
      • Depending on how rough that code is, you have an extra $self in there, which probably changes things.

        • Heh, fortunately that code was just typed off the cuff. The real code -- probably -- did not have that particular problem.

          Unfortunately, due to other issues in the module I was extending, I ended up having to do something more complex. I hope to have a reason to play with SUPER sometime in the future!
          --
          rjbs