Make cleanup of encodings, moving webpac closer to having
[webpac2] / lib / WebPAC / Validate.pm
index a86f841..d7ed6fb 100644 (file)
@@ -135,7 +135,7 @@ sub read_validate_file {
                if (@d) {
                        $v->{$fld} = [ map {
                                my $sf = $_;
-                               if ( $sf =~ s/!(\*)?$/$1/ ) {
+                               if ( $sf =~ s/!// ) {
                                        $self->{must_exist_sf}->{ $fld }->{ $sf }++;
                                };
                                $sf;
@@ -294,7 +294,7 @@ sub validate_rec {
                                                        if ( ref($v->{$sf}) eq 'ARRAY' ) {
                                                                $sf_repeatable->{$sf}++;
                                                        };
-                                                       if (! first { $_ eq $sf } @{ $r->{$f} }) {
+                                                       if (! defined first { $_ eq $sf } @{ $r->{$f} }) {
                                                                $errors->{ $f }->{subfield}->{extra}->{$sf}++;
                                                        }
                                                }
@@ -593,6 +593,8 @@ sub save_delimiters_templates {
        close($d);
 
        $log->info("new delimiters templates saved to $path");
+
+       return 1;
 }
 
 =head1 AUTHOR