Ok, so you are aware of what I was speaking about in my last post, here is how you should have presented your code:
-
$off = 'OFF';
-
chomp($off);
-
-
$on = 'ON';
-
chomp($on);
-
-
if(($fizrm == $off) && ($wizrm == $off)) {
-
system(' echo "Izmir RM Replication OFF" > /home/ahmet/repl_scr/izrmmail ');
-
}
-
elsif(($fizrm == $on) && ($wizrm == $on)) {
-
system(' echo "Izmir RM Replication ON" > /home/ahmet/repl_scr/izrmmail ');
-
} elsif(($fizrm == $on) && ($wizrm == $off)) {
-
system(' echo "Izmir RM Replication PARTIAL" > /home/ahmet/repl_scr/izrmmail');
-
}
-
elsif(($fizrm == $off) && ($wizrm == $on)) {
-
system(' echo "Izmir RM Replication PARTIAL" > /home/ahmet/repl_scr/izrmmail');
-
}
-
Now, in looking at this, I notice you are using a numerical comparison operator (==) to compare text, when you shoudl be using "eq" instead. "eq" will compare text.
Make sure that you have the following pragmas in use:
-
use strict;
-
use warnings;
-
We have no way of knowing as we cannot see your entire script. If you did have them on, you should have gotten warnings about doing a numerical comparison on a string.
Also, just a note. You shouldn't have to "chomp" the variables as you are setting them in the script and not getting the input from command line. The "chomp" command would remove the carriage return that the user enters after typing their entry.
Regards,
Jeff