in reply to Re: ^6 Parse backup log
in thread Parse backup log

I would suggest changing your create_entry function to look like this:

sub create_entry { # If only two fields are present, the index must # be "expired" (rather than expiring.) $_[1] = 'expired' if @_ == 2; my ($tape_id, @rest) = @_; push (@{$tape_index{$tape_id}}, [$tape_id, @rest]); }

The problem you're experiencing is that when you have a line like:

ST4910 (FROZEN)
you are only getting two fields in your hash. The tape_id, and "(FROZEN)" for the expired field. You then are searching on the "expired" key, which is not present. By changing your create_entry function to the above, both the "expired" and "expires" keys will be properly created.

Replies are listed 'Best First'.
Re: ^8 Parse backup log
by mrbbq (Sexton) on Apr 20, 2004 at 22:20 UTC
    That works great! Thanks for all the help....bowing down to your monkdom....