below is a sample script I wrote and in the testing section there is what I thought was a simple IF/Else statement. the output I get when I run this all fall in the "Else" but that is not my expected results. I am not new to scripting, but relativly new to perl. is my IF statement, quotes, or operators wrong?
please help!
##################################################
##################################################
$nor= "operating_normally";
$mir= "mirrorclone_synching";
@vdisks = ("disk1",disk2,disk3,disk4,disk5,disk6,disk7);
@vdstate = ($nor,$nor,$nor,$nor,$mir,$nor,$mir);
$count3 = 0;
foreach $item (@vdstate) {
if (length($item) > 19) {
$notready = 1;
# print $vdstate[$count3] .",\n";
}
#####testing######
#print "vdisk=$vdisks[$count3] state=$vdstate[$count3] \n";
if ("$vdstat[$count3]"eq"mirrorclone_synching") {
print "****** VDISK=$vdisks[$count3] STATE=$vdstate[$count3] \n";
}
else {
print "else*$vdstate[$count3]*-VS-*mirrorclone_synching*\n";
}
##### end testing #######
$count3++;
}
print " \n notready=$notready \n";
print "end \n";
######################################################
######################################################
please help!
##################################################
##################################################
$nor= "operating_normally";
$mir= "mirrorclone_synching";
@vdisks = ("disk1",disk2,disk3,disk4,disk5,disk6,disk7);
@vdstate = ($nor,$nor,$nor,$nor,$mir,$nor,$mir);
$count3 = 0;
foreach $item (@vdstate) {
if (length($item) > 19) {
$notready = 1;
# print $vdstate[$count3] .",\n";
}
#####testing######
#print "vdisk=$vdisks[$count3] state=$vdstate[$count3] \n";
if ("$vdstat[$count3]"eq"mirrorclone_synching") {
print "****** VDISK=$vdisks[$count3] STATE=$vdstate[$count3] \n";
}
else {
print "else*$vdstate[$count3]*-VS-*mirrorclone_synching*\n";
}
##### end testing #######
$count3++;
}
print " \n notready=$notready \n";
print "end \n";
######################################################
######################################################