my %config ( smtp_destination => 'mail.server.com', nas_array_ip_list => 'C:/path/to/nas_array_ip_list.txt', smtp_msg_from => 'name@email.com', smtp_msg_to => 'name@email.com', mail_file => 'C:/path/to/dmcheck.txt', username => 'username', password => 'password', reason => '/nas/sbin/getreason', nasmailmsg_from => 'name@email.com', nasmailmsg_to => 'name@email.com', dm_check => 'dmcheck.txt', ); #### MIME::Lite->send('smtp', $config{smtp_destination}); if (! open my $fh, '<', $config{nas_array_ip_list}) ... #### system 'del dmcheck.txt'; #### unlink $config{dm_check} or warn "Could not unlink file '$config{dm_check}': $!";