It's early morning so I'm only coming up with awkward solutions but my brain says 'try
UNIVERSAL::
can.' You could do
... if __PACKAGE__->can('dd'), for example. This doesn't seem like a great idea though. I'd rather just call them and have them become no-op functions internally. You could turn them on and off at runtime that way as well.