You are using subroutines incorrectly. You are not passing any data to the subroutines. You are not returning any data from the subroutines. You do not have any data that is local to the subroutines, all the data is global. And you only really need subroutines for code that will be called more than once but all your sbroutines are only called one time.
You should include the warnings and strict pragmas so that perl can help you find mistakes, for example:
@fetchList= ( productModel, # productVersion, # cpuUpTime, # miscGlobalStatusMessage, # diskTotalCount, # diskActiveCount, # diskReconstructingCount, # diskReconstructingParityCount, # diskFailedCount, # envFailedFanCount, # envFailedPowerSupplyCount, # nvramBatteryStatus # );
should probably be like this instead:
@fetchList= qw( productModel productVersion cpuUpTime miscGlobalStatusMessage diskTotalCount diskActiveCount diskReconstructingCount diskReconstructingParityCount diskFailedCount envFailedFanCount envFailedPowerSupplyCount nvramBatteryStatus );
$temp[1]=~s/\/$//g;
You are using the $ anchor which says to only match at the end of the string and you are using the /g option which says to match everywhere in the string. You can use one or the other but not both.
In reply to Re: FilerProbe: Tidy Up Your NetApp
by jwkrahn
in thread FilerProbe: Tidy Up Your NetApp
by bpoag
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |