--- trunk/lib/WebPAC/Validate.pm 2006/05/16 15:23:05 515 +++ trunk/lib/WebPAC/Validate.pm 2006/05/16 15:23:12 516 @@ -69,15 +69,18 @@ foreach my $l (split(/[\n\r]+/, $v_file)) { $curr_line++; - # skip comments - next if ($l =~ m/^#/); + + # skip comments and whitespaces + next if ($l =~ /^#/ || $l =~ /^\s*$/); $l =~ s/^\s+//; $l =~ s/\s+$//; my @d = split(/\s+/, $l); - my $fld = shift @d || $log->logdie("need field name in line $curr_line: $l"); + my $fld = shift @d; + + $log->logdie("need field name in line $curr_line: $l") unless (defined($fld)); if (@d) { $v->{$fld} = \@d; @@ -91,6 +94,8 @@ $self->{rules} = $v; + $log->info("validation uses rules from $self->{path}"); + $self ? return $self : return undef; } @@ -118,7 +123,7 @@ foreach my $f (keys %{ $rec }) { - next if (!defined($f) || $f eq ''); + next if (!defined($f) || $f eq '' || $f eq '000'); if (! defined($r->{$f})) { push @errors, "field '$f' shouldn't exists";