Hello Monks! I again have gotten in over my head and need guidence. Here is my delema. I have a command that produces output like this:

ACTIVE FULL SUSPENDED FROZEN IMPORTED ST0315 (FROZEN) ST0306 (FROZEN) ST0304 (FROZEN) ST0314 (FROZEN) ST0308 (FROZEN) ST0309 (FROZEN) ST0312 (FROZEN) ST4910 (FROZEN) ST4782 expires 06/19/2004 22:00 (FROZEN) ST2838 expires 07/09/2004 20:46 (FROZEN) ST4173 expires 07/10/2004 20:30 (FROZEN) ST1606 expires 07/14/2004 22:43 (FROZEN) ST4717 expires 05/14/2004 00:55 ST6481 expires 05/16/2004 05:22 ST2058 expires 05/16/2004 03:55 ST6540 expires 05/16/2004 01:36 ST6476 expires 05/16/2004 01:18 ST6486 expires 05/16/2004 01:35 ST1467 expires 05/16/2004 03:55 ST4730 expires 05/16/2004 01:48 ST5353 expires 05/16/2004 01:35 ST5833 expires 05/16/2004 01:36 ST3325 expires 05/16/2004 01:25 ST5413 expires 05/16/2004 01:18 ST5676 expires 05/16/2004 01:49 ST2044 expires 05/16/2004 01:46 ST3276 expires 05/16/2004 01:04
here is my script:
#!/usr/local/bin/perl open (IMAGES, "/usr/openv/netbackup/bin/admincmd/bpmedialist -summary +|"); open (HTML, ">/usr/openv/netbackup/stats/frozen.html") || die "Can't o +pen output!"; select(HTML); set_date(); match(); sort_tapes(); write_html(); close IMAGES; close HTML; ## ## Subroutines... ## ## sub set_date { my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); ($mday < 10) ? ($mday = 0 . $mday) : ($mday =+ $mday); (($mon + 1) < 10) ? ($mon = 0 . ($mon + 1)) : $mon++; my $stamp; $hour = 0 . $hour if ($hour < 10); if ($hour > 12) { $hour = $hour - 12; $stamp = 'PM'; } elsif ($hour eq '12') { $stamp = 'PM'; } else { $stamp = 'AM'; } $min = 0 . $min if ($min < 10); $sec = 0 . $sec if ($sec < 10); my ($date_today) = $mon . '/' . $mday . '/' . $year; my ($time) = $hour . ':' . $min . ':' . $sec . " $stamp"; $rdate_today = \$date_today; $rtime = \$time; } sub match { while (<IMAGES>) { if ($_ =~ /^(\s+)MVA/o) { $_ =~ s/(\s+)//o; chop; my ($tape_id, $expiration, $date, $time, $stat +us) = split (/ /) create_entry($tape_id, $expiration, $date, $ti +me, $status) if ($status eq "(FROZEN)"); } } } sub create_entry { my ($tape_id, $index, $date, $time, $status) = @_; my ($rlEntry) = [$tape_id, $index, $date, $time, $status]; push (@{$tape_index{$tape_id}}, $rlEntry); } sub sort_tapes { my %hold_sort; foreach $tape (sort keys %tape_index) { my ($rlEntry) = @{$tape_index{$tape}}; push (@{$hold_sort{$rlEntry->[1]}}, $rlEntry); } %tape_index = %hold_sort; } sub write_html { print "<HTML><HEAD><TITLE>Netbackup Frozen Tape Report</TITLE> +<H1><CENTER>HEVA-ATL Frozen Tape Report</H1></CENTER></HEAD><B R><CENTER><FONT SIZE=5>Last updated: $$rdate_today <BR>at $$rtime </FO +NT></CENTER><BODY BGCOLOR=white><BR><BR><CENTER><TABLE BORDER= 4 WIDTH=60%><TR ALIGN=CENTER><TD>Media ID</TD><TD>Expiration Date</TD> +<TD>Expiration Time</TD></TR>\n";<br> if (@{$tape_index{expired}}) { print "<TR ALIGN=CENTER><TD COLSPAN=3>Currently Frozen + Tapes (remove)</TD></TR>\n"; foreach $tape (@{$tape_index{expired}}) { print "<TR ALIGN=CENTER><TD>$tape->[0]</TD><TD +>$tape->[2]</TD><TD>$tape->[3]</TD></TR>\n";<br> } } else { print "<TR ALIGN=CENTER><TD COLSPAN=3>No currently exp +ired FROZEN tapes</TD></TR>\n"; } if (@{$tape_index{expires}}) { print "<TR ALIGN=CENTER><TD COLSPAN=3>The following ar +e FROZEN but NOT yet expired</TD></TR>\n"; foreach $tape (@{$tape_index{expires}}) { print "<TR ALIGN=CENTER><TD>$tape->[0]</TD><TD +>$tape->[2]</TD><TD>$tape->[3]\n</TD></TR>";<br> } } else { print "<TR ALIGN=CENTER><TD>No other frozen tapes.</TD +></TR>"; } print "</TABLE></CENTER></BODY></HTML>\n"; }
even though FROZEN appears in the output of the first command I am not getting any matches? Can anyone give me some insight on this? It always tells me It cant find anything that matches frozen. Thanks!

Edited by theorbtwo: Add code tags, remove br tags.

janitored by ybiC: Retitle from antithetical "Clueeless and need help". But I *do* mean that in the kindest possible way, mrbbq. 8^)


In reply to Parse backup log by mrbbq

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.