/[webpac]/trunk/marc_sf.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/marc_sf.pm

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

revision 139 by dpavlin, Wed Oct 29 23:19:58 2003 UTC revision 620 by dpavlin, Sat Jan 1 18:16:21 2005 UTC
# Line 4  Line 4 
4  # e.g. marc_sf($row,'700','a')  # e.g. marc_sf($row,'700','a')
5  #  #
6  sub marc_sf {  sub marc_sf {
7          my $marc = shift @_;          my $marc = shift @_ || die "marc_sf: needs record";
8          my $f = shift @_;          my $f = shift @_ || die "marc_sf: needs field name";
9          my $s = shift @_;          my $s = shift @_;
10    
11          my $i = shift @_ || 0;          my $i = shift @_ || 0;
12    
13          my @out = $marc->getvalue({record=>$marc->marc_count(),field=>$f,subfield=>$s});          my @out;
14            if ($s) {
15                    @out = $marc->subfield($f,$s);
16            } else {
17                    @out = $marc->field($f)->as_string() if ($marc->field($f));
18            }
19    
20          return $out[$i] if (@out && $out[$i]);          return $out[$i] if (@out && $out[$i]);
21  }  }

Legend:
Removed from v.139  
changed lines
  Added in v.620

  ViewVC Help
Powered by ViewVC 1.1.26