/[webpac]/branches/unesco/hash_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 /branches/unesco/hash_sf.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 684 - (hide annotations)
Mon Feb 28 10:43:38 2005 UTC (19 years, 1 month ago) by dpavlin
File size: 576 byte(s)
updated branches to head

1 dpavlin 10 #
2 dpavlin 678 # hash_sf($row_data,'field'[,'subfield'])
3 dpavlin 10 #
4 dpavlin 678 # e.g. hash_sf($row,'700','a')
5 dpavlin 10 #
6 dpavlin 678 sub hash_sf {
7 dpavlin 10 my $row = shift @_;
8 dpavlin 678 my $field = shift @_;
9 dpavlin 10 my $subfield = shift @_;
10    
11 dpavlin 29 my $i = shift @_ || 0;
12    
13     my $out;
14    
15 dpavlin 678 if ($row->{$field}->[$i]) {
16 dpavlin 45 if (! $subfield) {
17 dpavlin 10 # subfield list undef, empty or no defined subfields for this record
18 dpavlin 678 my $all_sf = $row->{record}->{$field}->[$i] || confess "can't find field $field:$i",Dumper($row);
19     $all_sf =~ s/[\^\$]./ /g; # nuke definitions
20 dpavlin 29 return $all_sf;
21 dpavlin 45 }
22 dpavlin 678 my $sf = $row->{$field}->[$i]->{$subfield};
23 dpavlin 619 return $sf if ($sf);
24 dpavlin 10 }
25     }
26    
27     1;
28    

Properties

Name Value
cvs2svn:cvs-rev 1.5

  ViewVC Help
Powered by ViewVC 1.1.26