Changeset 8716 for trunk/gsdl/perllib/doc.pm
- Timestamp:
- 2004-12-01T16:14:11+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/doc.pm
r8504 r8716 95 95 my $newobj = {}; 96 96 97 foreach $k (keys %$self) {97 foreach my $k (keys %$self) { 98 98 $newobj->{$k} = &clone ($self->{$k}); 99 99 } … … 109 109 if ($type eq "HASH") { 110 110 my $to = {}; 111 foreach $key (keys %$from) {111 foreach my $key (keys %$from) { 112 112 $to->{$key} = &clone ($from->{$key}); 113 113 } … … 115 115 } elsif ($type eq "ARRAY") { 116 116 my $to = []; 117 foreach $v (@$from) {117 foreach my $v (@$from) { 118 118 push (@$to, &clone ($v)); 119 119 } … … 128 128 my ($type) = @_; 129 129 130 if ($type eq "incremental") {130 if ($type =~ /^(hash|incremental|dirname)$/) { 131 131 $self->{'OIDtype'} = $type; 132 132 } else { … … 638 638 $OID = "D" . $OIDcount; 639 639 $OIDcount ++; 640 641 } elsif ($self->{'OIDtype'} eq "dirname") { 642 $OID = 'J'; 643 my $filename = $self->get_source_filename(); 644 if (defined($filename) && -e $filename) { 645 $OID = &File::Basename::dirname($filename); 646 if (defined $OID) { 647 $OID = 'J'.&File::Basename::basename($OID); 648 } else { 649 print STDERR "Failed to find base for filename ($filename).....\n"; 650 die("\n"); 651 } 652 } else { 653 print STDERR "Failed to find filename.....\n"; 654 die("\n"); 655 } 640 656 641 657 } else { … … 1002 1018 my $section_ptr = $self->_lookup_section($section); 1003 1019 if (!defined $section_ptr) { 1004 print STDERR "doc::get_metadata_element couldn't find section " . 1005 "$section\n"; 1020 print STDERR "doc::get_metadata_element couldn't find section ", $section, "\n"; 1006 1021 return; 1007 1022 } … … 1036 1051 my $section_ptr = $self->_lookup_section($section); 1037 1052 if (!defined $section_ptr) { 1038 print STDERR "doc::get_metadata couldn't find section " .1039 "$section\n";1053 print STDERR "doc::get_metadata couldn't find section ", 1054 $section, "\n"; 1040 1055 return; 1041 1056 } … … 1068 1083 my $section_ptr = $self->_lookup_section($section); 1069 1084 if (!defined $section_ptr) { 1070 print STDERR "doc::get_all_metadata couldn't find section " . 1071 "$section\n"; 1085 print STDERR "doc::get_all_metadata couldn't find section ", $section, "\n"; 1072 1086 return; 1073 1087 } … … 1083 1097 my $section_ptr = $self->_lookup_section($section); 1084 1098 if (!defined $section_ptr) { 1085 print STDERR "doc::delete_metadata couldn't find section " . 1086 "$section\n"; 1099 print STDERR "doc::delete_metadata couldn't find section ", $section, "\n"; 1087 1100 return; 1088 1101 } … … 1105 1118 my $section_ptr = $self->_lookup_section($section); 1106 1119 if (!defined $section_ptr) { 1107 print STDERR "doc::delete_all_metadata couldn't find section " . 1108 "$section\n"; 1120 print STDERR "doc::delete_all_metadata couldn't find section ", $section, "\n"; 1109 1121 return; 1110 1122 } … … 1149 1161 my $section_ptr = $self->_lookup_section($section); 1150 1162 if (!defined $section_ptr) { 1151 print STDERR "doc::add_utf8_metadata couldn't find section " . 1152 "$section\n"; 1163 print STDERR "doc::add_utf8_metadata couldn't find section ", $section, "\n"; 1153 1164 return; 1154 1165 }
Note:
See TracChangeset
for help on using the changeset viewer.