System:
Situation:
util2.pl
has to use Mail::Sender as I could not get a newer email sending program to work in our Perl, even after searching for pages, etc. So for now, we have to use Mail::Sender.util2.pl
is included in every program in the chain via require /path/to/util2.pl
.perl /path/to/program.pl bunch of arguments 2>/tmp/stderr.txt
but I still get an email from cron with this error messages. That is, I get an email with this error message every 10 minutes of every day of the week. I end up with thousands of emails with this message.Questions:
Thank you so much, this has been quite a headache for me.
The warning comes from this line:
warnings::warnif('deprecated', 'Mail::Sender is deprecated and you should look to Email::Sender instead');
If you look into warnings, you'll see that a category can be turned off by
no warnings 'deprecated';
So, wrap the use Mail::Sender
into
{ no warnings 'deprecated';
use Mail::Sender;
}
Or directly comment out the line.
The correct solution would be to switch to Email::Sender, though. Whatever hack you implement, consider and plan a real fix, which is to stop using the deprecated library.