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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.