Hi,
I have this script which rotate postfix outgoing IP periodically. This script was running fine with perl version 5.8.0. But having problem which running on a new server which has perl version v5.8.8. The error is:
Code:
Use of uninitialized value in string eq at ./test_aol.pl line 7.
Use of uninitialized value in string eq at ./test_aol.pl line 7.
Use of uninitialized value in concatenation (.) or string at ./test_aol.pl line 19.
The perl script is:
Code:
#!/usr/bin/perl -w
open(AOL_SWITCH, "</scripts/aol_switch.dat");
$ip = <AOL_SWITCH>;
close(AOL_SWITCH);
if($ip eq "xx.xx.xx.xx")
{
$newip = "xx.xx.xx.xx";
$host = "mail2";
}
elsif($ip eq "xx.xx.xx.xx")
{
$newip = "xx.xx.xx.xx";
$host = "mail3";
}
open(MAIN_CF_MAIN, "</etc/postfix/main.cf-main");
open(MAIN_CF, ">/etc/postfix/main.cf");
while(<MAIN_CF_MAIN>)
{
print MAIN_CF $_;
}
close(MAIN_CF_MAIN);
print MAIN_CF "\n";
print MAIN_CF "smtp_bind_address = ".$newip."\n";
print MAIN_CF "myhostname = ".$host.".OURDOMAIN.com\n";
close(MAIN_CF);
open(AOL_SWITCH, ">/scripts/aol_switch.dat");
print AOL_SWITCH $newip;
close(AOL_SWITCH);
Thanks for your response in advance.