use Scalar::Util qw( blessed ); sub debug { my $self = shift; return unless exists $self->{LOGGER}; return unless blessed $self->{LOGGER}; return unless $self->{LOGGER}->can('debug'); $self->{LOGGER}->debug(@_); }