use Log::Log4perl qw(get_logger :levels); my $log4perl_conf=< %m%n CFG ; Log::Log4perl::init(\$log4perl_conf); my $logger = Log::Log4perl->get_logger(); $logger->info('Something bad is happening'); #### use Mail::Sendmail; # TLRTSRMG-CapacityPlanning@thomson.com %mail = ( To => 'me@company.com', From => 'me@company.com', Message => "Sorry, testing this out for emailing -- please ignore", Subject => "DELETE ME: Email Testing" ); sendmail(%mail) or die $Mail::Sendmail::error; print "OK. Log says:\n", $Mail::Sendmail::log;