/[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

Annotation of /trunk/marc_sf.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 620 - (hide annotations)
Sat Jan 1 18:16:21 2005 UTC (14 years, 11 months ago) by dpavlin
File size: 418 byte(s)
use newer MARC::File::USMARC instead of MARC

1 dpavlin 62 #
2 dpavlin 105 # marc_sf($marc,'field'[,'subfield'])
3 dpavlin 62 #
4 dpavlin 105 # e.g. marc_sf($row,'700','a')
5 dpavlin 62 #
6 dpavlin 105 sub marc_sf {
7 dpavlin 169 my $marc = shift @_ || die "marc_sf: needs record";
8     my $f = shift @_ || die "marc_sf: needs field name";
9 dpavlin 62 my $s = shift @_;
10    
11     my $i = shift @_ || 0;
12    
13 dpavlin 620 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 dpavlin 139
20 dpavlin 90 return $out[$i] if (@out && $out[$i]);
21 dpavlin 62 }
22    
23     1;
24    

Properties

Name Value
cvs2svn:cvs-rev 1.6

  ViewVC Help
Powered by ViewVC 1.1.26