I haven't used Perl for Web page stuff, so just some guesses here. LP has been upgrading servers over the last month or so, and it's possible that some code (of yours) that was legal before is now a problem (security issues, etc.). Without some sort of error message telling you why it failed, "it stopped working" doesn't leave much to go on. Nothing at all
comes through, or just bad email content? No error messages embedded in the email, or on the screen, or in some sort of log file (like PHP does with error_log)?
I seem to recall seeing reports in various places of email getting stricter about its formatting, and in some place \n might now have to be \n\n and vice-versa. I wouldn't go randomly changing anything, though, until you've done some research. I'm not sure that " (Web Hit xxx)" is legitimate in a "From" field -- you might try removing it or moving it into the body. Maybe that's what's hanging you up now.
The Perl code looks fairly clean. It opens a file handle MAIL which is piping content to the sendmail command. You might double-check that /usr/sbin/sendmail hasn't been moved to some other place, or accidentally lost during an upgrade (open a support ticket). The "To" and "From" address lines are sent. $_ is a variable assigned the HTTP_REFERER field, and (the first) "http://www.domain.com
" is replaced by a "-". A big "Subject" line is assembled with the REMOTE_ADDR, QUERY_STRING, modified HTTP_REFERER, and the count. Finally, the body of the email appears to be just the REMOTE_ADDR. You might think about debugging this by print "$_\n";
etc. to dump the variables on-screen (temporarily) and see if everything looks like it's there, with reasonable content.
I take it this is just a fragment of the entire Perl code, as $count must be set somewhere. Good luck with debugging!