I am modifying a script one of my predecessors wrote, and I am curious as to what this snippet means. In particular the '$line[7] portion means and is doing...
$search = '$line[7] =~ /' . "$JOBEND" . '/';
if (eval $search) {
# First check whether the bytecount is nonzero
if ($line[17] ne '0') {
$status{$current} = $statcode{$JOBEND};
} else {
$status{$current} = $statcode{$JOBFAIL};
};
$endtime{$current} = $line[2] . " ";
$endtime{$current} .= $line[3] . " ";
$endtime{$current} .= $line[4] . " ";
$endtime{$current} .= $line[5] . " ";
$endtime{$current} .= $line[6];
}
$search = '$line[7] =~ /' . "$JOBEND" . '/';
if (eval $search) {
# First check whether the bytecount is nonzero
if ($line[17] ne '0') {
$status{$current} = $statcode{$JOBEND};
} else {
$status{$current} = $statcode{$JOBFAIL};
};
$endtime{$current} = $line[2] . " ";
$endtime{$current} .= $line[3] . " ";
$endtime{$current} .= $line[4] . " ";
$endtime{$current} .= $line[5] . " ";
$endtime{$current} .= $line[6];
}