in reply to Working around non-polymorphic __DATA__ sections

For what it's worth, this looks like a good case for the common idiom for object-or-class methods:
my $self = shift; my $class = ref($self) || $self;