sub UNIVERSAL::bind_meth { my ($self, $meth, @args) = @_; my $func = $self->can($meth); if (defined($func)) { return sub {$func->($self, @args, @_)}; } else { return undef; } }