/[webpac2]/trunk/lib/WebPAC/Normalize.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/Normalize.pm

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

revision 979 by dpavlin, Sat Nov 3 12:37:43 2007 UTC revision 1011 by dpavlin, Tue Nov 6 20:26:31 2007 UTC
# Line 1  Line 1 
1  package WebPAC::Normalize;  package WebPAC::Normalize;
2  use Exporter 'import';  use Exporter 'import';
3  @EXPORT = qw/  our @EXPORT = qw/
4          _set_rec _set_lookup          _set_ds _set_lookup
5          _set_load_row          _set_load_row
6          _get_ds _clean_ds          _get_ds _clean_ds
7          _debug          _debug
# Line 24  use Exporter 'import'; Line 24  use Exporter 'import';
24    
25          get set          get set
26          count          count
27    
28  /;  /;
29    
30  use warnings;  use warnings;
# Line 37  use Carp qw/confess/; Line 38  use Carp qw/confess/;
38  # debugging warn(s)  # debugging warn(s)
39  my $debug = 0;  my $debug = 0;
40    
41    use WebPAC::Normalize::ISBN;
42    push @EXPORT, ( 'isbn_10', 'isbn_13' );
43    
44  =head1 NAME  =head1 NAME
45    
# Line 44  WebPAC::Normalize - describe normalisato Line 47  WebPAC::Normalize - describe normalisato
47    
48  =cut  =cut
49    
50  our $VERSION = '0.31';  our $VERSION = '0.32';
51    
52  =head1 SYNOPSIS  =head1 SYNOPSIS
53    
# Line 102  sub data_structure { Line 105  sub data_structure {
105          die "need row argument" unless ($arg->{row});          die "need row argument" unless ($arg->{row});
106          die "need normalisation argument" unless ($arg->{rules});          die "need normalisation argument" unless ($arg->{rules});
107    
         # FIXME load this conditionally  
 #       use WebPAC::Normalize::ISBN;  
   
         no strict 'subs';  
108          _set_lookup( $arg->{lookup} ) if defined($arg->{lookup});          _set_lookup( $arg->{lookup} ) if defined($arg->{lookup});
109          _set_rec( $arg->{row} );          _set_ds( $arg->{row} );
110          _set_config( $arg->{config} ) if defined($arg->{config});          _set_config( $arg->{config} ) if defined($arg->{config});
111          _clean_ds( %{ $arg } );          _clean_ds( %{ $arg } );
112          $load_row_coderef = $arg->{load_row_coderef};          $load_row_coderef = $arg->{load_row_coderef};
113    
114          eval "$arg->{rules}";          no strict 'subs';
115            no warnings 'redefine';
116            eval "$arg->{rules};";
117          die "error evaling $arg->{rules}: $@\n" if ($@);          die "error evaling $arg->{rules}: $@\n" if ($@);
118    
119          return _get_ds();          return _get_ds();
120  }  }
121    
122  =head2 _set_rec  =head2 _set_ds
123    
124  Set current record hash  Set current record hash
125    
126    _set_rec( $rec );    _set_ds( $rec );
127    
128  =cut  =cut
129    
130  my $rec;  my $rec;
131    
132  sub _set_rec {  sub _set_ds {
133          $rec = shift or die "no record hash";          $rec = shift or die "no record hash";
134  }  }
135    
# Line 172  my ($out, $marc_record, $marc_encoding, Line 173  my ($out, $marc_record, $marc_encoding,
173  my ($marc_record_offset, $marc_fetch_offset) = (0, 0);  my ($marc_record_offset, $marc_fetch_offset) = (0, 0);
174    
175  sub _get_ds {  sub _get_ds {
176    #warn "## out = ",dump($out);
 warn "## out = ",dump($out);  
   
177          return $out;          return $out;
178  }  }
179    

Legend:
Removed from v.979  
changed lines
  Added in v.1011

  ViewVC Help
Powered by ViewVC 1.1.26