Hi Monks, I need your help. I have no perl programming experience and have been using a banner exchange script for a long time now successfully until I migrated over to a new server with a newer version of perl (5.8.8 to 5.10.1). I am wondering if someone could help me to update the script to current standards. When trying to login to admin I see these errors in my logs:
$* is no longer supported at ads_admin.pl line 4296. Premature end of script headers: ads_admin.pl.
I have researched on google and see that I have to make changes using /s or /m but as I stated I have no programming experience. Can anyone help me? Here is the code:
if ($mailprog eq "SMTP") {
unless ($WEB_SERVER) { $WEB_SERVER = $ENV{'SERVER_NAME'}; }
if (!$WEB_SERVER) { &Error_Mail; }
unless ($SMTP_SERVER) {
$SMTP_SERVER = "smtp.$WEB_SERVER";
$SMTP_SERVER =~ s/^smtp\.[^.]+\.([^.]+\.)/smtp.$1/;
}
# local($AF_INET) = ($] > 5 ? AF_INET : 2);
# local($SOCK_STREAM) = ($] > 5 ? SOCK_STREAM : 1);
local($AF_INET) = 2;
local($SOCK_STREAM) = 1;
$, = ', ';
$" = ', ';
local($local_address) = (gethostbyname($WEB_SERVER))[4];
local($local_socket_address) = pack('S n a4 x8', $AF_INET, 0,
+$local_address);
local($server_address) = (gethostbyname($SMTP_SERVER))[4];
local($server_socket_address) = pack('S n a4 x8', $AF_INET, '2
+5', $server_address);
local($protocol) = (getprotobyname('tcp'))[2];
if (!socket(SMTP, $AF_INET, $SOCK_STREAM, $protocol)) { &Error
+_Mail; }
bind(SMTP, $local_socket_address);
if (!(connect(SMTP, $server_socket_address))) { &Error_Mail; }
local($old_selected) = select(SMTP);
$| = 1;
select($old_selected);
$* = 1;
select(undef, undef, undef, .75);
sysread(SMTP, $_, 1024);
print SMTP "HELO $WEB_SERVER\r\n";
sysread(SMTP, $_, 1024);
while (/(^|(\r?\n))[^0-9]*((\d\d\d).*)$/g) {
$status = $4;
$message = $3;
}