http://qs321.pair.com?node_id=145530

drix has asked for the wisdom of the Perl Monks concerning the following question:

What's the right way to do this here newfangled "function template"? I'm subclassing HTML::Filter and overriding all the methods in an identical fashion. Here's the relevant code:

#!/usr/bin/perl sub fillTemplate { my $funcName = shift; my $index = shift; sub { my $self = shift; sanityCheck($self); ($self->{inTheComment} == 1) ? push @{$self->{killBuffer}}, $_[$index] : $self->SUPER::$funcName(@_); } } for $function ( [ 'declaration', 0 ], [ 'start', 3 ], [ 'text', 0 ], [ 'end', 1 ] ) { *($function->[0]) = fillTemplate($function->[0],$function->[1]); + }

Perl doesn't like me referring to $self->SUPER::$funcName. What's the proper way? Dispensing with the template and writing it all out, the line reads $self->SUPER::start, $self->SUPER::end, etc.