--- omni2db.pl 2002/09/11 18:11:07 1.2 +++ omni2db.pl 2002/09/11 20:54:24 1.3 @@ -10,12 +10,14 @@ my %omni; sub db { + return if (scalar keys %omni != 6); + my $rv = $dbh->do("update gantt set finish=now() where sessionid='$omni{SessionID}' and type='$omni{Session_type}' and status='$omni{Session_status}' and - user_group_host='".$omni{'User.Group@Host'}."' and + user_group_host='".$omni{'User.Group@Host'}||''."' and specification='$omni{Backup_Specification}'"); print "rv: $rv\n" if ($debug); @@ -32,18 +34,19 @@ while() { chomp; if (/^$/) { - db() if (scalar keys %omni == 6); + db(); %omni = (); print "------------\n" if ($debug); next; } s/^[\t\s]+//; my ($l,$r) = split (/\s*:\s*/,$_,2); - $l =~ s/\s+/_/g; - $r =~ s/\s+$//g; - print "$l -> $r\n" if ($debug); - $omni{$l} = $r; - + if ($r) { + $l =~ s/\s+/_/g; + $r =~ s/\s+$//g; + print "$l -> $r\n" if ($debug); + $omni{$l} = $r; + } } db(); close(O);