/[Biblio-Isis]/trunk/lib/Biblio/Isis.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/Biblio/Isis.pm

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

revision 65 by dpavlin, Thu Jul 13 13:34:30 2006 UTC revision 66 by dpavlin, Fri Aug 25 10:20:58 2006 UTC
# Line 7  use File::Glob qw(:globally :nocase); Line 7  use File::Glob qw(:globally :nocase);
7  BEGIN {  BEGIN {
8          use Exporter ();          use Exporter ();
9          use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);          use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
10          $VERSION     = 0.22;          $VERSION     = 0.23;
11          @ISA         = qw (Exporter);          @ISA         = qw (Exporter);
12          #Give a hoot don't pollute, do not export more than needed by default          #Give a hoot don't pollute, do not export more than needed by default
13          @EXPORT      = qw ();          @EXPORT      = qw ();
# Line 548  have original record subfield order and Line 548  have original record subfield order and
548  Define delimiter which will be used to join repeatable subfields. You can  Define delimiter which will be used to join repeatable subfields. You can
549  specify option here instead in L</new> if you want to have per-record control.  specify option here instead in L</new> if you want to have per-record control.
550    
551    =item hash_filter
552    
553    You can override C<hash_filter> defined in L</new> using this option.
554    
555  =back  =back
556    
557  =cut  =cut
# Line 559  sub to_hash { Line 563  sub to_hash {
563          my $mfn = shift || confess "need mfn!";          my $mfn = shift || confess "need mfn!";
564          my $arg;          my $arg;
565    
566            my $hash_filter = $self->{hash_filter};
567    
568          if (ref($mfn) eq 'HASH') {          if (ref($mfn) eq 'HASH') {
569                  $arg = $mfn;                  $arg = $mfn;
570                  $mfn = $arg->{mfn} || confess "need mfn in arguments";                  $mfn = $arg->{mfn} || confess "need mfn in arguments";
571                    $hash_filter = $arg->{hash_filter} if ($arg->{hash_filter});
572          }          }
573    
574          # init record to include MFN as field 000          # init record to include MFN as field 000
# Line 577  sub to_hash { Line 584  sub to_hash {
584                  foreach my $l (@{$row->{$f_nr}}) {                  foreach my $l (@{$row->{$f_nr}}) {
585    
586                          # filter output                          # filter output
587                          if ($self->{'hash_filter'}) {                          $l = $hash_filter->($l, $f_nr) if ($hash_filter);
588                                  $l = $self->{'hash_filter'}->($l, $f_nr);                          next unless defined($l);
                                 next unless defined($l);  
                         }  
589    
590                          my $val;                          my $val;
591                          my $r_sf;       # repeatable subfields in this record                          my $r_sf;       # repeatable subfields in this record
# Line 746  know any details about it's version. Line 751  know any details about it's version.
751  As this is young module, new features are added in subsequent version. It's  As this is young module, new features are added in subsequent version. It's
752  a good idea to specify version when using this module like this:  a good idea to specify version when using this module like this:
753    
754    use Biblio::Isis 0.21    use Biblio::Isis 0.23
755    
756  Below is list of changes in specific version of module (so you can target  Below is list of changes in specific version of module (so you can target
757  older versions if you really have to):  older versions if you really have to):
758    
759  =over 8  =over 8
760    
761    =item 0.23
762    
763    Added C<hash_filter> to L</to_hash>
764    
765  =item 0.22  =item 0.22
766    
767  Added field number when calling C<hash_filter>  Added field number when calling C<hash_filter>

Legend:
Removed from v.65  
changed lines
  Added in v.66

  ViewVC Help
Powered by ViewVC 1.1.26