spinUp(); collectJobs(); parseJobs(); spinDown(); sub spinUp() {

Why the subroutines?    All the variables are global and nothing is passed to them so it's not to protect local variables.    They are only called once at the beginning of the script so it's not to reuse code.    What is the point?


foreach $item (@tempJobsTable) { $item=~s/\s+/ /g; @thisJob=split(" ",$item);

If the first argument to split is a string containing a single space character then split removes all whitespace characters so your use of a substitution to remove all whitespace characters first is redundant.    You can achieve exactly the same result like this:

foreach (@tempJobsTable) { @thisJob=split;

if ($failureType{$thisJob[6]}=="") { $failureType{$thisJob[6]}=$thisJob[3]; }

You are using a numerical comparison operator on a string so perl will conveniently convert that string to the number 0 to perform the comparison.    Perhaps you meant to use the eq string comparison operator instead?    Or the exists or defined funtions?


$lastValidBackupTime=`/usr/openv/netbackup/bin +/admincmd/bpcatlist -client $client 2>&1 | grep $client | head -n1 | +awk '{print $2}'`;

You are getting a single field from a single line from an externally executed command.    Because AWK splits its fields on whitespace the only whitespace in the returned string will be the newline that the backquotes add.

$lastValidBackupTime=~s/\s+/ /g;

You are converting the newline at the end of the string to a single space character.

@temp=split(" ",$lastValidBackupTime);

You are assigning to $temp[0] the contents of $lastValidBackupTime.

$lastValidBackupTime="$temp[1] $temp[2] $temp[ +3] $temp[4]";

You are assigning to $lastValidBackupTime the string "   ".

Why did you do all that just to assign three spaces to $lastValidBackupTime?


In reply to Re: Failboat -- An Emotionally Disturbed Tool For Checking NetBackup Client Coverage by jwkrahn
in thread Failboat -- An Emotionally Disturbed Tool For Checking NetBackup Client Coverage 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.