open(my$fh,'>:encoding(UTF-8)',$filename)||(croak"Can't open '$filename', $!");
print$fh$value;
close($fh)||(croak"could not close file '$filename', $!");
return1;
}
# this will patch the mods-xml as a workaround for bugs in LOCs xslt files
sub patch_mods($){
if(!defined$_[0]){croak"modsobject not defined!";}
if($_[0]eq""){die"invalid parameters.";}
my$modsobj=shift;# mods expected as XML Parser object
# TODO: Bugfix for /mets:mets/mets:dmdSec[1]/mets:mdWrap[1]/mets:xmlData[1]/mods:modsCollection[1]/mods:mods[1]/mods:relatedItem[2]/mods:internetMediaType[1]
B<This program> will process the given IE directory, add bibliographic metadata from catalogue with given PICA number and check and create a SIP directory ready for SLUBarchiv