If you run your select statement in the mysql cli, it will generate a warning. Since your script is not redirecting warnings to the browser, that message was never displayed with the rest of the output.

The adjustments that I suggested, in particular the { RaiseError => 1} portion would have raised that warning to a fatal error which would then have been displayed in the browser and added to the web server error log.

#!/usr/bin/perl use warnings FATAL => 'all'; use strict; use diagnostics; use CGI qw/param/; use POSIX qw/strftime/; use DBI; use CGI::Carp qw(fatalsToBrowser); # remove this when the script is complete and put into production use Data::Dumper;

The best 2 things you can do for those of us that help you is to give your honest appreciation for our time and learn how to do this on your own so that you can repay this effort of ours by helping/teaching others.

I was trying to improve the code a bit the other day and ran into a slight snag. It is working as I was wanting, but it's creating two errors that I'm having a problem figuring out. I was trying to eliminate the need to tell it to send 1, 2 or 3. I added an extra table to the database to handle the cell sms address after their cell number and also to create a log file.

It seems to be acting like it's processing all the if and elsif but still working as I was hoping.

It still writes all the files and only sends the correct one. (Not a big deal, but it's an error.)

2nd) I'm now getting a mail error in the logs, but it's sending the mail just fine.

The error message is telling you that your syntax for the mail command is incomplete. You should read the man page for the mail command to learn how it should be used. I don't use it and don't want to guess on its usage.