use MyLogger; my $logger = MyLogger->new( logfile => '/var/log/my.log', loglevel => 'warn', ); my $a = 'some_value'; $logger->debug( $a );