/[webpac2]/trunk/lib/WebPAC/Validate.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Validate.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 671 by dpavlin, Mon Sep 11 15:59:35 2006 UTC revision 677 by dpavlin, Wed Sep 13 17:44:57 2006 UTC
# Line 18  WebPAC::Validate - provide simple valida Line 18  WebPAC::Validate - provide simple valida
18    
19  =head1 VERSION  =head1 VERSION
20    
21  Version 0.08  Version 0.09
22    
23  =cut  =cut
24    
25  our $VERSION = '0.08';  our $VERSION = '0.09';
26    
27  =head1 SYNOPSIS  =head1 SYNOPSIS
28    
# Line 41  configuration file in following format: Line 41  configuration file in following format:
41    205! a    205! a
42    # while 210 can have a c or d    # while 210 can have a c or d
43    210 a c d    210 a c d
44      # field which is ignored in validation
45      999-
46    
47  =head1 FUNCTIONS  =head1 FUNCTIONS
48    
# Line 86  sub new { Line 88  sub new {
88    
89                  if ($fld =~ s/!$//) {                  if ($fld =~ s/!$//) {
90                          $self->{must_exist}->{$fld}++;                          $self->{must_exist}->{$fld}++;
91                    } elsif ($fld =~ s/-$//) {
92                            $self->{dont_validate}->{$fld}++;
93                  }                  }
94    
95                  $log->logdie("need field name in line $curr_line: $l") unless (defined($fld));                  $log->logdie("need field name in line $curr_line: $l") unless (defined($fld));
# Line 142  sub validate_errors { Line 146  sub validate_errors {
146    
147                  next if (!defined($f) || $f eq '' || $f eq '000');                  next if (!defined($f) || $f eq '' || $f eq '000');
148    
149                    next if (defined( $self->{dont_validate}->{$f} ));
150    
151                    # track field usage
152                  $fields->{$f}++;                  $fields->{$f}++;
153    
154                  if ( ! defined($r->{$f}) ) {                  if ( ! defined($r->{$f}) ) {

Legend:
Removed from v.671  
changed lines
  Added in v.677

  ViewVC Help
Powered by ViewVC 1.1.26