--- trunk/lib/WebPAC/Normalize.pm 2007/11/03 13:33:19 980 +++ trunk/lib/WebPAC/Normalize.pm 2007/11/06 20:26:31 1011 @@ -1,7 +1,7 @@ package WebPAC::Normalize; use Exporter 'import'; our @EXPORT = qw/ - _set_rec _set_lookup + _set_ds _set_lookup _set_load_row _get_ds _clean_ds _debug @@ -47,7 +47,7 @@ =cut -our $VERSION = '0.31'; +our $VERSION = '0.32'; =head1 SYNOPSIS @@ -105,30 +105,31 @@ die "need row argument" unless ($arg->{row}); die "need normalisation argument" unless ($arg->{rules}); - no strict 'subs'; _set_lookup( $arg->{lookup} ) if defined($arg->{lookup}); - _set_rec( $arg->{row} ); + _set_ds( $arg->{row} ); _set_config( $arg->{config} ) if defined($arg->{config}); _clean_ds( %{ $arg } ); $load_row_coderef = $arg->{load_row_coderef}; - eval "$arg->{rules}"; + no strict 'subs'; + no warnings 'redefine'; + eval "$arg->{rules};"; die "error evaling $arg->{rules}: $@\n" if ($@); return _get_ds(); } -=head2 _set_rec +=head2 _set_ds Set current record hash - _set_rec( $rec ); + _set_ds( $rec ); =cut my $rec; -sub _set_rec { +sub _set_ds { $rec = shift or die "no record hash"; } @@ -172,9 +173,7 @@ my ($marc_record_offset, $marc_fetch_offset) = (0, 0); sub _get_ds { - -warn "## out = ",dump($out); - +#warn "## out = ",dump($out); return $out; }