Hi,
Iam new to perl and new to programming full stop
I am writing in perl to read a file no problem then i have parsed the large txt file to read the data I want no problems but I am having severe difficulty with the last piece this is going to be ran daily it is going to check the percentage levels of each disk if it is above 80% i need it to issue a warning
I have parsed all lines containing % sign i have tried split, tried to move these lines to a new array but cannot get anything to work can anybody help me with this here is what I have done for the last part
[CODE=perl]
foreach my $lines (@array_of_data ) {
if ($lines =~ m/[%]/i) {
print "$lines\n";
#push ($line,@array)
#print "@array [4]\n";
#print "@array\n";
#@array = split(/[ ]+/, $line);
#tr\%\ d;
if ($array_of_data[4]>80 ) {
print "Please look at this disk immediately\n";
} else {
print "Disk levels are ok\n";
}
}
}
[/CODE]
Iam new to perl and new to programming full stop
I am writing in perl to read a file no problem then i have parsed the large txt file to read the data I want no problems but I am having severe difficulty with the last piece this is going to be ran daily it is going to check the percentage levels of each disk if it is above 80% i need it to issue a warning
I have parsed all lines containing % sign i have tried split, tried to move these lines to a new array but cannot get anything to work can anybody help me with this here is what I have done for the last part
[CODE=perl]
foreach my $lines (@array_of_data ) {
if ($lines =~ m/[%]/i) {
print "$lines\n";
#push ($line,@array)
#print "@array [4]\n";
#print "@array\n";
#@array = split(/[ ]+/, $line);
#tr\%\ d;
if ($array_of_data[4]>80 ) {
print "Please look at this disk immediately\n";
} else {
print "Disk levels are ok\n";
}
}
}
[/CODE]
Comment