#
# marc_sf($marc,'field'[,'subfield'])
#
# e.g. marc_sf($row,'700','a')
#
sub marc_sf {
	my $marc = shift @_ || die "marc_sf: needs record";
	my $f = shift @_ || die "marc_sf: needs field name";
	my $s = shift @_;

	my $i = shift @_ || 0;

	my $rec = $main::cache->{marc_record} || die '$cache->{marc_record} is undefined!';

	my @out = $marc->getvalue({record=>$rec,field=>$f,subfield=>$s});

	return $out[$i] if (@out && $out[$i]);
}

1;

