MARC-File-MARCMaker-0.05/ 755 0 0 0 10331114353 7476 5MARC-File-MARCMaker-0.05/bin/ 755 0 0 0 10331114421 10242 5MARC-File-MARCMaker-0.05/bin/mkr2mrc 644 0 0 5216 10331114304 11546 #!perl =head2 Converts MARCMaker format files into raw MARC (ISO 2709) format. =head1 SYNOPSIS B [options] file(s) =over 4 =item options =over 4 =item --help Print a summary of commands =item --[no]stats Print a record count by file at the end. (Default: on) =back =back =head2 TODO Separate warnings printing from record printing. Print records to file rather than screen? =cut ########################### ### Initialize includes ### ### and basic needs ### ########################### use strict; use warnings; use MARC::File::USMARC; use MARC::File::MARCMaker; use MARC::Record; use Getopt::Long; use constant USAGE => <<"END"; Usage: mkr2mrc [options] file(s) options --help Print a summary of commands --version Print version --[no]quiet Suppress status messages --[no]stats Print a record count by file at the end END print ("Welcome to MARCMaker to MARC script\n"); my $stats = 1; my $help = 0; my $quiet = 0; my $rc = GetOptions( "stats!" => \$stats, "quiet!" => \$quiet, "help" => \$help, "version" => sub { print "$0, using MARC::Record v$MARC::Record::VERSION and MARC::File::MARCMaker v$MARC::File::MARCMaker::VERSION\n"; exit 1; }, ); my @files = @ARGV; die USAGE if $help or (not $rc) or (@files == 0); my %counts; my %errors; for my $filename ( @files ) { $counts{$filename} = 0; $errors{$filename} = 0; my $file = MARC::File::MARCMaker->in( $filename ) or die $MARC::File::ERROR; my $runningrecordcount = 0; while (my $record = $file->next()) { if ( not $record ) { warn $MARC::Record::ERROR; ++$errors{$filename}; } else { ++$counts{$filename}; } #else record decoded print $record->as_usmarc(); if ( my @warnings = $record->warnings() ) { ++$errors{$filename}; print join( "\n", @warnings, "" ); } #if warnings found during decoding process } # while $file->close(); } # for if ( $stats ) { print "\n\n"; print " Recs Errs Filename\n"; print "----- ----- --------\n"; for my $key ( sort keys %counts ) { printf( "%5d %5d %s\n", $counts{$key}, $errors{$key}, $key ); } # for } # if stats ##################### ### END OF PROGRAM ## ##################### =head1 LICENSE This code may be distributed under the same terms as Perl itself. Please note that this code is not a product of or supported by the employers of the various contributors to the code. =head1 AUTHOR Bryan Baldus eija [at] inwave [dot] com Based on marclint. Copyright (c) 2005 =cut    0         0  ?"`0@4444"PDp@HUHD 3# H 3#p L p@3# `4D'4<#MARC-File-MARCMaker-0.05/bin/mrc2mkr 644 0 0 5554 10331114304 11553 #!perl =head2 Converts raw MARC (ISO 2709) format files into MARCMaker format. =head1 SYNOPSIS B [options] file(s) =over 4 =item options =over 4 =item --help Print a summary of commands =item --[no]stats Print a record count by file at the end. (Default: on) =back =back =head2 TODO Separate warnings printing from record printing. Print records to file rather than screen? Update once as_marcmaker() method is available for full record encoding. =cut ########################### ### Initialize includes ### ### and basic needs ### ########################### use strict; use warnings; use MARC::Record; use MARC::File::USMARC; use MARC::File::MARCMaker; use Getopt::Long; use constant USAGE => <<"END"; Usage: mkr2mrc [options] file(s) options --help Print a summary of commands --version Print version --[no]quiet Suppress status messages --[no]stats Print a record count by file at the end END my $stats = 1; my $help = 0; my $quiet = 0; my $rc = GetOptions( "stats!" => \$stats, "quiet!" => \$quiet, "help" => \$help, "version" => sub { print "$0, using MARC::Record v$MARC::Record::VERSION and MARC::File::MARCMaker v$MARC::File::MARCMaker::VERSION\n"; exit 1; }, ); my @files = @ARGV; die USAGE if $help or (not $rc) or (@files == 0); ######################### ### Start main program ## ######################### print ("Welcome to MARC to MARCMaker script\n"); my %counts; my %errors; for my $filename ( @files ) { $counts{$filename} = 0; $errors{$filename} = 0; my $file = MARC::File::USMARC->in( $filename ) or die $MARC::File::ERROR; warn "$filename\n" unless $quiet; my $runningrecordcount = 0; while (my $record = $file->next()) { if ( not $record ) { warn $MARC::Record::ERROR; ++$errors{$filename}; } else { ++$counts{$filename}; } #else record decoded print MARC::File::MARCMaker->encode($record); if ( my @warnings = $record->warnings() ) { ++$errors{$filename}; print join( "\n", $record->title, @warnings, "" ); } #if warnings found during decoding process } # while $file->close(); } # for if ( $stats ) { print "\n\n"; print " Recs Errs Filename\n"; print "----- ----- --------\n"; for my $key ( sort keys %counts ) { printf( "%5d %5d %s\n", $counts{$key}, $errors{$key}, $key ); } # for } # if stats ##################### ### END OF PROGRAM ## ##################### =head1 LICENSE This code may be distributed under the same terms as Perl itself. Please note that this code is not a product of or supported by the employers of the various contributors to the code. =head1 AUTHOR Bryan Baldus eija [at] inwave [dot] com Based on marclint. Copyright (c) 2005 =cuton Right String.StandardGetFolder -- Special Characters String!StandardGetFolder -- Error Dialog2StandardGetFolder -- Get Folder Dialog With Button&MARC-File-MARCMaker-0.05/Changes 644 0 0 1613 10331114304 10766 Version History Version 0.05: First CPAN release, Oct. 30, 2005. -Moved 00.load.t.txt to 00.load.t -Removed ABSTRACT_FROM from Makefile.PL since it wasn't working -Modified t/marmaker.t to not emit warnings and output that might confuse the test harness. Version 0.04: Updated Oct. 20. Initial commit to SourceForge CVS, Oct. 23, 2005. -Initial commit to CVS on SourceForge. -Misc. cleanup. -Basic versions of bin/mrc2mkr and bin/mkr2mrc example programs. Version 0.03: Updated Aug. 2, 2005. Released Aug. 14, 2005. -Revised decode() to fix problem with dollar sign conversion from mnemonics to characters. Version 0.02: Updated July 12-13, 2005. Released July 16, 2005. -Preliminary version of encode() for fields and records Version 0.01: Initial version, Nov. 21, 2004-Mar. 7, 2005. Released Mar. 7, 2005. -Basic version, translates .mrk format file into MARC::Record objects. :G7 37 7 0MARC-File-MARCMaker-0.05/lib/ 755 0 0 0 10331114402 10237 5MARC-File-MARCMaker-0.05/lib/MARC/ 755 0 0 0 10331114402 10761 5MARC-File-MARCMaker-0.05/lib/MARC/File/ 755 0 0 0 10331114406 11644 5MARC-File-MARCMaker-0.05/lib/MARC/File/MARCMaker.pm 644 0 0 73715 10331114306 13740 #!perl package MARC::File::MARCMaker; =head1 NAME MARC::File::MARCMaker -- Work with MARCMaker/MARCBreaker records. =cut use strict; use integer; use vars qw( $VERSION $ERROR ); $VERSION = 0.05; use MARC::File; use vars qw( @ISA ); @ISA = qw( MARC::File ); use MARC::Record qw( LEADER_LEN ); use constant SUBFIELD_INDICATOR => "\x24"; #dollar sign use constant END_OF_FIELD => "\n\x3D"; #line break, equals sign =head1 SYNOPSIS use MARC::File::MARCMaker; my $file = MARC::File::MARCMaker->in( $filename ); while ( my $marc = $file->next() ) { # Do something } $file->close(); undef $file; #################################################### use MARC::File::MARCMaker; ## reading with MARC::Batch my $batch = MARC::Batch->new( 'MARCMaker', $filename ); my $record = $batch->next(); ## or reading with MARC::File::MARCMaker explicitly my $file = MARC::File::MARCMaker->in( $filename ); my $record = $file->next(); ## output a single MARC::Record object in MARCMaker format (formatted plain text) #print $record->as_marcmaker(); #goal syntax print MARC::File::MARCMaker->encode($record); #current syntax =head1 DESCRIPTION The MARC-File-MARCMaker distribution is an extension to the MARC-Record distribution for working with MARC21 data using the format used by the Library of Congress MARCMaker and MARCBreaker programs. More information may be obtained here: L You must have MARC::Record installed to use MARC::File::MARCMaker. In fact once you install the MARC-File-MARCMaker distribution you will most likely not use it directly, but will have an additional file format available to you when you use MARC::Batch. This module is based on code from the original MARC.pm module, as well as the MARC::Record distribution's MARC::File::USMARC and MARC::File::MicroLIF modules. =head2 DEVIATIONS FROM LC'S DOCUMENTATION LC's MARCMaker/MARCBreaker programs require files to have DOS line endings. This module should be capable of reading any type of line ending. It converts existing endings to "\n", the endings of the platform. Initial version may or may not work well with line breaks in the middle of a field. MARCMaker version of the LDR (record size bytes) will not necessarily be dependable, and should not be relied upon. =head1 EXPORT None. =head1 TODO Do limit tests in filling the buffer and getting chunks. Seems to work for first fill, but may fail on larger reads/multiple reads to fill the buffer. Test special characters (those requiring escapes). Initial version may not fully support non-English characters. All MARC-8 may work, Unicode support is untested and unassured. Implement better character encoding and decoding, including Unicode support. Work on character set internal subs for both input and output. Currently, the original subs from MARC.pm are being used essentially as-is. Error checking for line breaks vs. new fields? Probably not possible, since line breaks are allowed within fields, so checking for missing equals sign is not really possible. Account for multiple occurences of =LDR in a single record, usually caused by lack of blank line between records, so records get mushed together. Also check for multiple =001s. Determine why the constant SUBFIELD_INDICATOR can't be used in the split into subfields. Work on encode(). Allow as_marcmaker() to be called with either MARC::Field or MARC::Record objects, returning the appropriate result. Desired behavior is as_usmarc() methods in MARC::Record and MARC::Field Decode should mostly be working. Test for correctness. Remove unnecessary code and documentation, remnants of the initial development of the module. Move internal subs to end of module? =head1 VERSION HISTORY Version 0.05: First CPAN release, Oct. 30, 2005. Version 0.04: Updated Oct. 22, 2005. Released Oct. 23, 2005. -Initial commit to CVS on SourceForge -Misc. cleanup. Version 0.03: Updated Aug. 2, 2005. Released Aug. 14, 2005. -Revised decode() to fix problem with dollar sign conversion from mnemonics to characters. Version 0.02: Updated July 12-13, 2005. Released July 16, 2005. -Preliminary version of encode() for fields and records Version 0.01: Initial version, Nov. 21, 2004-Mar. 7, 2005. Released Mar. 7, 2005. -Basic version, translates .mrk format file into MARC::Record objects. =for internal ############################################################ This section is copied from MARC::File::MicroLIF. ############################################################ The buffer must be large enough to handle any valid record because we don't check for cases like a CR/LF pair or an end-of-record/CR/LF trio being only partially in the buffer. The max valid record is the max MARC record size (99999) plus one or two characters per tag (CR, LF, or CR/LF). It's hard to say what the max number of tags is, so here we use 6000. (6000 tags can be squeezed into a MARC record only if every tag has only one subfield containing a maximum of one character, or if data from multiple tags overlaps in the MARC record body. We're pretty safe.) =cut use constant BUFFER_MIN => (99999 + 6000 * 2); =head1 METHODS =cut ################################## ### START OF MARCMAKER METHODS ### ################################## =head2 _next (merged from MicroLIF and USMARC) Called by MARC::File::next(). =cut sub _next { #done for MARCMaker? my $self = shift; #_get_chunk will separate records from each other and should convert # line endings to those of the platform. my $makerrec = $self->_get_chunk(); # for ease, make sure the newlines match this platform $makerrec =~ s/[\x0d\x0a]+/\n/g if defined $makerrec; return $makerrec; } #_next =head2 decode( $string [, \&filter_func ] ) (description based on MARC::File::USMARC::decode POD information) Constructor for handling data from a MARCMaker file. This function takes care of all the tag directory parsing & mangling. Any warnings or coercions can be checked in the C function. The C<$filter_func> is an optional reference to a user-supplied function that determines on a tag-by-tag basis if you want the tag passed to it to be put into the MARC record. The function is passed the tag number and the raw tag data, and must return a boolean. The return of a true value tells MARC::File::MARCMaker::decode that the tag should get put into the resulting MARC record. For example, if you only want title and subject tags in your MARC record, try this: sub filter { my ($tagno,$tagdata) = @_; return ($tagno == 245) || ($tagno >= 600 && $tagno <= 699); } my $marc = MARC::File::MARCMaker->decode( $string, \&filter ); Why would you want to do such a thing? The big reason is that creating fields is processor-intensive, and if your program is doing read-only data analysis and needs to be as fast as possible, you can save time by not creating fields that you'll be ignoring anyway. Another possible use is if you're only interested in printing certain tags from the record, then you can filter them when you read from disc and not have to delete unwanted tags yourself. =cut sub decode { #MARCMaker my $text; my $location = ''; ## decode can be called in a variety of ways ## $object->decode( $string ) ## MARC::File::MARCMaker->decode( $string ) ## MARC::File::MARCMaker::decode( $string ) ## this bit of code covers all three my $self = shift; if ( ref($self) =~ /^MARC::File/ ) { $location = 'in record '.$self->{recnum}; $text = shift; } else { $location = 'in record 1'; $text = $self=~/MARC::File/ ? shift : $self; } my $filter_func = shift; # for ease, make the newlines match this platform # this has probably already been taken care of at least once, but just in case $text =~ s/[\x0d\x0a]+/\n/g if defined $text; my $marc = MARC::Record->new(); #report improperly passed $text (undefined $text) return $marc->_warn( "Unable to retrieve a record string $location" ) unless defined $text; ############################# #### Charset work needed #### ############################# #use default charset until that function is revised my $charset = usmarc_default(); ############################# ############################# #Split each record on the "\n=" into the @lines array my @lines=split END_OF_FIELD, $text; my $leader = shift @lines; unless ($leader =~ /^=LDR /) { $marc->_warn( "First line must begin with =LDR" ); } $leader=~s/^=LDR //; #Remove "=LDR " $leader=~s/[\n\r]//g; #remove line endings $leader=~s/\\/ /g; # substitute " " for \ #report error if result is not 24 bytes long unless (length($leader) == LEADER_LEN) { $marc->_warn( "Leader must be exactly 24 bytes long" ); } #add leader to the record $marc->leader( substr( $leader, 0, LEADER_LEN ) ); LINE: foreach my $line (@lines) { #Remove newlines from $line ; and also substitute " " for \ $line=~s/[\n\r]//g; $line=~s/\\/ /g; #get the tag name my $tagno = substr($line,0,3); # Check tag validity ( $tagno =~ /^[0-9A-Za-z]{3}$/ ) or $marc->_warn( "Invalid tag in $location: \"$tagno\"" ); if ( ($tagno =~ /^\d+$/ ) && ( $tagno < 10 ) ) { #translate characters for tag data #revise line below as needed for _maker2char my $tagdata = _maker2char ( substr( $line, 5 ), $charset ); #filter_func implementation needs work if ( $filter_func ) { next LINE unless $filter_func->( $tagno, $tagdata ); } #add field to record $marc->append_fields( MARC::Field->new( $tagno, $tagdata ) ); } #if $tagno < 10 else { #translate characters for subfield data #get indicators my $ind1 = substr( $line, 5, 1 ); my $ind2 = substr( $line, 6, 1 ); my $tagdata = substr( $line, 7 ); #report error if first character of tagdata is not a subfield indicator ($) $marc->_warn( "First character of subfield data must be a subfield indicator (dollar sign), $tagdata, $location for tag $tagno" ) unless ($tagdata =~ /^\$/ ); if ( $filter_func ) { next LINE unless $filter_func->( $tagno, $tagdata ); } #why doesn't SUBFIELD_INDICATOR work in the split? my @subfields_mnemonic = split( /\x24/, $tagdata ); #convert characters from mnemonics to characters my @subfields = map {_maker2char($_, $charset)} @subfields_mnemonic; #is there a better way to deal with the empty first item? my $empty = shift @subfields; $marc->_warn( "Subfield data appears before first subfield? $location in $tagno" ) if $empty; # Split the subfield data into subfield name and data pairs my @subfield_data; for ( @subfields ) { if ( length > 0 ) { push( @subfield_data, substr($_,0,1),substr($_,1) ); } else { $marc->_warn( "Entirely empty subfield found in tag $tagno" ); } } #for @subfields if ( !@subfield_data ) { $marc->_warn( "no subfield data found $location for tag $tagno" ); next; } my $field = MARC::Field->new($tagno, $ind1, $ind2, @subfield_data ); if ( $field->warnings() ) { $marc->_warn( $field->warnings() ); } $marc->append_fields( $field ); } } # looping through all the fields return $marc; } #decode MARCMaker =head2 update_leader() #from USMARC This may be unnecessary code. Delete this section if that is the case. If any changes get made to the MARC record, the first 5 bytes of the leader (the length) will be invalid. This function updates the leader with the correct length of the record as it would be if written out to a file. sub update_leader() { #from USMARC my $self = shift; my (undef,undef,$reclen,$baseaddress) = $self->_build_tag_directory(); $self->_set_leader_lengths( $reclen, $baseaddress ); } #updated_leader() from USMARC =head2 encode() #based on MARC::File::USMARC Returns a string of characters suitable for writing out to a MARCMaker file, including the leader, directory and all the fields. Uses as_marcmaker() below to build each field. =cut sub encode { #MARCMaker, based on USMARC's encode() my $marc = shift; $marc = shift if (ref($marc)||$marc) =~ /^MARC::File/; my $field_string = ''; #convert each field (after the leader) to MARCMaker format foreach my $field ($marc->fields()) { $field_string .= $field->MARC::File::MARCMaker::as_marcmaker(); } #foreach field in record # Glomp it all together return join("", "=LDR ", $marc->leader, "\n", $field_string, "\n"); } #encode from USMARC =head2 as_marcmaker() Based on MARC::Field::as_usmarc(). Turns a MARC::Field into a MARCMaker formatted field string. =head2 TODO (as_marcmaker()) -Change field encoding portion of as_marcmaker() to internal _as_marcmaker() -Implement as_marcmaker() as wrapper for MARC::Record object and MARC::Field object encoding into MARCMaker format. =cut sub as_marcmaker() { my $self = shift; # $self = shift if (ref($self)||$self) =~ /^MARC::File/; die "Wanted a MARC::Field but got a ", ref($self) unless ref($self) eq "MARC::Field"; my $charset = ustext_default(); # Tags < 010 are pretty easy if ( $self->is_control_field ) { #convert characters to MARCMaker codes my $field_data = (_char2maker($self->data(), $charset)); #swap blank spaces for backslash ( \ ) $field_data =~ s/ /\\/g; #return formatted field return sprintf "=%s %s\n", $self->tag(), $field_data; } #if control field elsif ($self->tag() eq '000') {print "Leader?\n"} #leader? else { my @subs; my @subdata = @{$self->{_subfields}}; while ( @subdata ) { #convert characters to MARCMaker codes as each subfield goes by push( @subs, join( "", SUBFIELD_INDICATOR, shift @subdata, (_char2maker(shift @subdata, $charset))) ); } # while my $ind1 = $self->indicator(1); my $ind2 = $self->indicator(2); #swap blank for backslash ( \ ) $ind1 =~ s/ /\\/g; $ind2 =~ s/ /\\/g; return join ("", "=", $self->tag(), " ", $ind1, $ind2, @subs, "\n", ); } } #as_usmarc() #MARC::Field #################################### ###### END USMARC subs ############# #################################### ######################################### ### begin internal subs from MicroLIF ### ######################################### ################################# # fill the buffer if we need to # ################################# sub _fill_buffer { #done for MARCMaker? my $self = shift; my $ok = 1; if ( !$self->{exhaustedfh} && length( $self->{inputbuf} ) < BUFFER_MIN ) { # append the next chunk of bytes to the buffer my $read = read $self->{fh}, $self->{inputbuf}, BUFFER_MIN, length($self->{inputbuf}); #convert line endings within the input buffer if ($self->{inputbuf} =~ /\x0d\x0a/s) { $self->{inputbuf} =~ s/\x0d\x0a/\n/sg; } #if DOS endings elsif ($self->{inputbuf} =~ /\x0a/) { $self->{inputbuf} =~ s/\x0a/\n/sg; } #elsif Unix endings elsif ($self->{inputbuf} =~ /\x0d/) { $self->{inputbuf} =~ s/\x0d/\n/sg; } #elsif Macintosh endings #remove extra blank lines between records $self->{inputbuf} =~ s/\n\s*\n+/\n\n/g; if ( !defined $read ) { # error! $ok = undef; $MARC::File::ERROR = "error reading from file " . $self->{filename}; } elsif ( $read < 1 ) { $self->{exhaustedfh} = 1; } } return $ok; } =for internal =head2 _get_chunk( ) #for MARCMaker Gets the next chunk of data (which should be a single complete record). All extra \r and \n are stripped and line endings are converted to those of the platform (\n). =cut sub _get_chunk { #done for MARCMaker? my $self = shift; my $chunk = undef; #read from the file and fill the input buffer if ( $self->_fill_buffer() && length($self->{inputbuf}) > 0 ) { #retrieve the next record ($chunk) = split /\n\n/, $self->{inputbuf}, 0; #remove the chunk and record separator from the input buffer $self->{inputbuf} = substr( $self->{inputbuf}, length($chunk)+length("\n\n") ); if ( !$chunk ) { $chunk = $self->{inputbuf}; $self->{inputbuf} = ''; $self->{exhaustedfh} = 1; } #if not chunk } #if buffer can be filled and has characters return $chunk; } #_get_chunk() =head2 _unget_chunk ( ) #done for MARCMaker? $chunk is put at the beginning of the buffer followed by two line endings ("\n\n") as a record separator. I don't know that this sub is necessary. =cut sub _unget_chunk { my $self = shift; my $chunk = shift; $self->{inputbuf} = $chunk . $self->{inputbuf}; return; } ####################################### ### End internal subs from MicroLIF ### ####################################### ####################################### ### Character handling from MARC.pm ### ####################################### =head2 _char2maker Pass in string of characters from a MARC record and a character map ($charset, or usmarc_default() by default). Returns string of characters encoded in MARCMaker format. (e.g. replaces '$' with {dollar}) =cut sub _char2maker { #deal with charmap default my @marc_string = split (//, shift); my $charmap = shift; #|| $charset; #add default value my $maker_string = join ('', map {${$charmap}{$_} } @marc_string); #replace html-style entities (´) with code in curly braces ({acute}) while ($maker_string =~ s/(&)([^ ]{1,7}?)(;)/{$2}/o) {} return $maker_string; } #_char2maker ###################### =head2 Default charset usmarc_default() -- Originally from MARC.pm. Offers default mnemonics for character encoding and decoding. Used by _maker2char. This perhaps should be an internal _usmarc_default(). =cut sub usmarc_default { # rec my @hexchar = (0x00..0x1a,0x1c,0x7f..0x8c,0x8f..0xa0,0xaf,0xbb, 0xbe,0xbf,0xc7..0xdf,0xfc,0xfd,0xff); my %inchar = map {sprintf ("%2.2X",int $_), chr($_)} @hexchar; $inchar{esc} = chr(0x1b); # escape $inchar{dollar} = chr(0x24); # dollar sign $inchar{curren} = chr(0x24); # dollar sign - alternate $inchar{24} = chr(0x24); # dollar sign - alternate $inchar{bsol} = chr(0x5c); # back slash (reverse solidus) $inchar{lcub} = chr(0x7b); # opening curly brace $inchar{rcub} = "}"; # closing curly brace - part 1 $inchar{joiner} = chr(0x8d); # zero width joiner $inchar{nonjoin} = chr(0x8e); # zero width non-joiner $inchar{Lstrok} = chr(0xa1); # latin capital letter l with stroke $inchar{Ostrok} = chr(0xa2); # latin capital letter o with stroke $inchar{Dstrok} = chr(0xa3); # latin capital letter d with stroke $inchar{THORN} = chr(0xa4); # latin capital letter thorn (icelandic) $inchar{AElig} = chr(0xa5); # latin capital letter AE $inchar{OElig} = chr(0xa6); # latin capital letter OE $inchar{softsign} = chr(0xa7); # modifier letter soft sign $inchar{middot} = chr(0xa8); # middle dot $inchar{flat} = chr(0xa9); # musical flat sign $inchar{reg} = chr(0xaa); # registered sign $inchar{plusmn} = chr(0xab); # plus-minus sign $inchar{Ohorn} = chr(0xac); # latin capital letter o with horn $inchar{Uhorn} = chr(0xad); # latin capital letter u with horn $inchar{mlrhring} = chr(0xae); # modifier letter right half ring (alif) $inchar{mllhring} = chr(0xb0); # modifier letter left half ring (ayn) $inchar{lstrok} = chr(0xb1); # latin small letter l with stroke $inchar{ostrok} = chr(0xb2); # latin small letter o with stroke $inchar{dstrok} = chr(0xb3); # latin small letter d with stroke $inchar{thorn} = chr(0xb4); # latin small letter thorn (icelandic) $inchar{aelig} = chr(0xb5); # latin small letter ae $inchar{oelig} = chr(0xb6); # latin small letter oe $inchar{hardsign} = chr(0xb7); # modifier letter hard sign $inchar{inodot} = chr(0xb8); # latin small letter dotless i $inchar{pound} = chr(0xb9); # pound sign $inchar{eth} = chr(0xba); # latin small letter eth $inchar{ohorn} = chr(0xbc); # latin small letter o with horn $inchar{uhorn} = chr(0xbd); # latin small letter u with horn $inchar{deg} = chr(0xc0); # degree sign $inchar{scriptl} = chr(0xc1); # latin small letter script l $inchar{phono} = chr(0xc2); # sound recording copyright $inchar{copy} = chr(0xc3); # copyright sign $inchar{sharp} = chr(0xc4); # sharp $inchar{iquest} = chr(0xc5); # inverted question mark $inchar{iexcl} = chr(0xc6); # inverted exclamation mark $inchar{hooka} = chr(0xe0); # combining hook above $inchar{grave} = chr(0xe1); # combining grave $inchar{acute} = chr(0xe2); # combining acute $inchar{circ} = chr(0xe3); # combining circumflex $inchar{tilde} = chr(0xe4); # combining tilde $inchar{macr} = chr(0xe5); # combining macron $inchar{breve} = chr(0xe6); # combining breve $inchar{dot} = chr(0xe7); # combining dot above $inchar{diaer} = chr(0xe8); # combining diaeresis $inchar{uml} = chr(0xe8); # combining umlaut $inchar{caron} = chr(0xe9); # combining hacek $inchar{ring} = chr(0xea); # combining ring above $inchar{llig} = chr(0xeb); # combining ligature left half $inchar{rlig} = chr(0xec); # combining ligature right half $inchar{rcommaa} = chr(0xed); # combining comma above right $inchar{dblac} = chr(0xee); # combining double acute $inchar{candra} = chr(0xef); # combining candrabindu $inchar{cedil} = chr(0xf0); # combining cedilla $inchar{ogon} = chr(0xf1); # combining ogonek $inchar{dotb} = chr(0xf2); # combining dot below $inchar{dbldotb} = chr(0xf3); # combining double dot below $inchar{ringb} = chr(0xf4); # combining ring below $inchar{dblunder} = chr(0xf5); # combining double underscore $inchar{under} = chr(0xf6); # combining underscore $inchar{commab} = chr(0xf7); # combining comma below $inchar{rcedil} = chr(0xf8); # combining right cedilla $inchar{breveb} = chr(0xf9); # combining breve below $inchar{ldbltil} = chr(0xfa); # combining double tilde left half $inchar{rdbltil} = chr(0xfb); # combining double tilde right half $inchar{commaa} = chr(0xfe); # combining comma above if ($MARC::DEBUG) { foreach my $str (sort keys %inchar) { printf "%s = %x\n", $str, ord($inchar{$str}); } } return \%inchar; } #usmarc_default ################################################### =head2 ustext_default ustext_default -- Originally from MARC.pm. Offers default mnemonics for character encoding and decoding. Used by _char2maker. This perhaps should be an internal _ustext_default(). =cut sub ustext_default { my @hexchar = (0x00..0x1a,0x1c,0x7f..0x8c,0x8f..0xa0,0xaf,0xbb, 0xbe,0xbf,0xc7..0xdf,0xfc,0xfd,0xff); my %outchar = map {chr($_), sprintf ("{%2.2X}",int $_)} @hexchar; my @ascchar = map {chr($_)} (0x20..0x23,0x25..0x7a,0x7c,0x7e); foreach my $asc (@ascchar) { $outchar{$asc} = $asc;} $outchar{chr(0x1b)} = '{esc}'; # escape $outchar{chr(0x24)} = '{dollar}'; # dollar sign $outchar{chr(0x5c)} = '{bsol}'; # back slash (reverse solidus) $outchar{chr(0x7b)} = '{lcub}'; # opening curly brace $outchar{chr(0x7d)} = '{rcub}'; # closing curly brace $outchar{chr(0x8d)} = '{joiner}'; # zero width joiner $outchar{chr(0x8e)} = '{nonjoin}'; # zero width non-joiner $outchar{chr(0xa1)} = '{Lstrok}'; # latin capital letter l with stroke $outchar{chr(0xa2)} = '{Ostrok}'; # latin capital letter o with stroke $outchar{chr(0xa3)} = '{Dstrok}'; # latin capital letter d with stroke $outchar{chr(0xa4)} = '{THORN}'; # latin capital letter thorn (icelandic) $outchar{chr(0xa5)} = '{AElig}'; # latin capital letter AE $outchar{chr(0xa6)} = '{OElig}'; # latin capital letter OE $outchar{chr(0xa7)} = '{softsign}'; # modifier letter soft sign $outchar{chr(0xa8)} = '{middot}'; # middle dot $outchar{chr(0xa9)} = '{flat}'; # musical flat sign $outchar{chr(0xaa)} = '{reg}'; # registered sign $outchar{chr(0xab)} = '{plusmn}'; # plus-minus sign $outchar{chr(0xac)} = '{Ohorn}'; # latin capital letter o with horn $outchar{chr(0xad)} = '{Uhorn}'; # latin capital letter u with horn $outchar{chr(0xae)} = '{mlrhring}'; # modifier letter right half ring (alif) $outchar{chr(0xb0)} = '{mllhring}'; # modifier letter left half ring (ayn) $outchar{chr(0xb1)} = '{lstrok}'; # latin small letter l with stroke $outchar{chr(0xb2)} = '{ostrok}'; # latin small letter o with stroke $outchar{chr(0xb3)} = '{dstrok}'; # latin small letter d with stroke $outchar{chr(0xb4)} = '{thorn}'; # latin small letter thorn (icelandic) $outchar{chr(0xb5)} = '{aelig}'; # latin small letter ae $outchar{chr(0xb6)} = '{oelig}'; # latin small letter oe $outchar{chr(0xb7)} = '{hardsign}'; # modifier letter hard sign $outchar{chr(0xb8)} = '{inodot}'; # latin small letter dotless i $outchar{chr(0xb9)} = '{pound}'; # pound sign $outchar{chr(0xba)} = '{eth}'; # latin small letter eth $outchar{chr(0xbc)} = '{ohorn}'; # latin small letter o with horn $outchar{chr(0xbd)} = '{uhorn}'; # latin small letter u with horn $outchar{chr(0xc0)} = '{deg}'; # degree sign $outchar{chr(0xc1)} = '{scriptl}'; # latin small letter script l $outchar{chr(0xc2)} = '{phono}'; # sound recording copyright $outchar{chr(0xc3)} = '{copy}'; # copyright sign $outchar{chr(0xc4)} = '{sharp}'; # sharp $outchar{chr(0xc5)} = '{iquest}'; # inverted question mark $outchar{chr(0xc6)} = '{iexcl}'; # inverted exclamation mark $outchar{chr(0xe0)} = '{hooka}'; # combining hook above $outchar{chr(0xe1)} = '{grave}'; # combining grave $outchar{chr(0xe2)} = '{acute}'; # combining acute $outchar{chr(0xe3)} = '{circ}'; # combining circumflex $outchar{chr(0xe4)} = '{tilde}'; # combining tilde $outchar{chr(0xe5)} = '{macr}'; # combining macron $outchar{chr(0xe6)} = '{breve}'; # combining breve $outchar{chr(0xe7)} = '{dot}'; # combining dot above $outchar{chr(0xe8)} = '{uml}'; # combining diaeresis (umlaut) $outchar{chr(0xe9)} = '{caron}'; # combining hacek $outchar{chr(0xea)} = '{ring}'; # combining ring above $outchar{chr(0xeb)} = '{llig}'; # combining ligature left half $outchar{chr(0xec)} = '{rlig}'; # combining ligature right half $outchar{chr(0xed)} = '{rcommaa}'; # combining comma above right $outchar{chr(0xee)} = '{dblac}'; # combining double acute $outchar{chr(0xef)} = '{candra}'; # combining candrabindu $outchar{chr(0xf0)} = '{cedil}'; # combining cedilla $outchar{chr(0xf1)} = '{ogon}'; # combining ogonek $outchar{chr(0xf2)} = '{dotb}'; # combining dot below $outchar{chr(0xf3)} = '{dbldotb}'; # combining double dot below $outchar{chr(0xf4)} = '{ringb}'; # combining ring below $outchar{chr(0xf5)} = '{dblunder}'; # combining double underscore $outchar{chr(0xf6)} = '{under}'; # combining underscore $outchar{chr(0xf7)} = '{commab}'; # combining comma below $outchar{chr(0xf8)} = '{rcedil}'; # combining right cedilla $outchar{chr(0xf9)} = '{breveb}'; # combining breve below $outchar{chr(0xfa)} = '{ldbltil}'; # combining double tilde left half $outchar{chr(0xfb)} = '{rdbltil}'; # combining double tilde right half $outchar{chr(0xfe)} = '{commaa}'; # combining comma above if ($MARC::DEBUG) { foreach my $num (sort keys %outchar) { printf "%x = %s\n", ord($num), $outchar{$num}; } } return \%outchar; } #ustext_default #################################################################### =head2 _maker2char default _maker2char() -- Translates MARCMaker encoded character into MARC-8 character. =cut sub _maker2char { # rec my $marc_string = shift; my $charmap = shift; while ($marc_string =~ /{(\w{1,8}?)}/o) { if (exists ${$charmap}{$1}) { $marc_string = join ('', $`, ${$charmap}{$1}, $'); } else { $marc_string = join ('', $`, '&', $1, ';', $'); } } # closing curly brace - part 2, permits {lcub}text{rcub} in input $marc_string =~ s/\}/\x7d/go; return $marc_string; } ################################ ### END OF MARCMAKER METHODS ### ################################ 1; =head1 RELATED MODULES L L =head1 SEE ALSO L L for more information about the DOS-based MARCMaker and MARCBreaker programs. The methods in this MARCMaker module are based upon MARC::File::USMARC.pm and MARC::File::MicroLIF.pm. Those are distributed with MARC::Record. The underlying code is based on the MARCMaker-related methods in MARC.pm. =head1 LICENSE This code may be distributed under the same terms as Perl itself. Please note that this module is not a product of or supported by the employers of the various contributors to the code. =head1 AUTHOR Bryan Baldus eijabb@cpan.org Copyright (c) 2004-2005. =cut (0xae); # modifier letter right half ring (alif)MARC-File-MARCMaker-0.05/Makefile.PL 644 0 0 674 10331114304 11433 use strict; use ExtUtils::MakeMaker; &WriteMakefile( NAME => 'MARC::File::MARCMaker', DISTNAME => 'MARC-File-MARCMaker', VERSION_FROM => 'lib/MARC/File/MARCMaker.pm', AUTHOR => 'Bryan Baldus ', PREREQ_PM => { 'Test::More' => 0, 'MARC::Record' => 0, }, EXE_FILES => [ qw( bin/mkr2mrc bin/mrc2mkr ) ], ); } = chr(0xc1); # latin small letter script l $inchar{phono} =MARC-File-MARCMaker-0.05/MANIFEST 644 0 0 214 10331114304 10600 bin/mrc2mkr bin/mkr2mrc Changes lib/MARC/File/MARCMaker.pm Makefile.PL MANIFEST README t/00.load.t t/camel.mrk t/camel.usmarc t/marcmaker.t (0xe6); # combining breve $inchar{dot} = chr(0xe7); # combining dot above $inchar{diaer} = chr(0xe8); # combining diaeresis $inchar{uml} = chr(0xe8); # combining umlaut $inchar{caron} = chr(0xe9); # combining hacek $inchar{ring} = chr(0xea); # combining ring above $inchar{llig} = chr(0xeb); # combiMARC-File-MARCMaker-0.05/README 644 0 0 1011 10331114304 10343 MARC::File::MARCMaker =========== MARC::File::MARCMaker -- Work with MARC data encoded in LC's MARCMaker and MARCBreaker format. This is based on code from the original MARC.pm, rewritten for MARC::Record compatibility. INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES - MARC::Record COPYRIGHT AND LICENCE This software is free software and may be distributed under the same terms as Perl itself. Copyright (C) 2005 Baldus, Summers e right half $inchar{commaa} = chr(0xfe); # combining comma above if ($MARC::DEBUG) { foreach my $str (sort keys %inchar) { printf "%s = %x\n", $str, ord($inchar{$str}); } } return \%inchar; } #usmarc_default ################################################### =head2 ustext_default ustext_default -- Originally from MARC.pm. Offers default mnemonics for character encoding and decoding. Used by _char2maker. This perhaps should be an internal _ustextMARC-File-MARCMaker-0.05/t/ 755 0 0 0 10331114365 7744 5MARC-File-MARCMaker-0.05/t/00.load.t 644 0 0 505 10331114306 11241 #!perl -w use strict; use Test::More tests=>6; BEGIN { use_ok( 'MARC::Record' ); use_ok( 'MARC::Batch' ); use_ok( 'MARC::Field' ); use_ok( 'MARC::File' ); use_ok( 'MARC::File::MARCMaker' ); use_ok( 'MARC::File::USMARC' ); } diag( "Testing MARC::File::MARCMaker $MARC::File::MARCMaker::VERSION" ); $outchar{chr(0xa9)} = '{flat}'; # musical flat sign $outchar{chr(0xaa)} = '{reg}'; # registered sign $outchar{chr(0xab)} = '{plusmn}'; # plus-minus sign $outchar{chrMARC-File-MARCMaker-0.05/t/camel.mrk 644 0 0 12754 10331114307 11565 =LDR 00755cam 22002414a 4500 =001 fol05731351\ =003 IMchF =005 20000613133448.0 =008 000107s2000\\\\nyua\\\\\\\\\\001\0\eng\\ =010 \\$a 00020737 =020 \\$a0471383147 (paper/cd-rom : alk. paper) =040 \\$aDLC$cDLC$dDLC =042 \\$apcc =050 00$aQA76.73.P22$bM33 2000 =082 00$a005.13/3$221 =100 1\$aMartinsson, Tobias,$d1976- =245 10$aActivePerl with ASP and ADO /$cTobias Martinsson. =260 \\$aNew York :$bJohn Wiley & Sons,$c2000. =300 \\$axxi, 289 p. :$bill. ;$c23 cm. +$e1 computer laser disc (4 3/4 in.) =500 \\$a"Wiley Computer Publishing." =650 \0$aPerl (Computer program language) =630 00$aActive server pages. =630 00$aActiveX. =LDR 00647pam 2200241 a 4500 =001 fol05754809\ =003 IMchF =005 20000601115601.0 =008 000203s2000\\\\mau\\\\\\\\\\\001\0\eng\\ =010 \\$a 00022023 =020 \\$a1565926994 =040 \\$aDLC$cDLC$dDLC =042 \\$apcc =050 00$aQA76.73.P22$bD47 2000 =082 00$a005.74$221 =100 1\$aDescartes, Alligator. =245 10$aProgramming the Perl DBI /$cAlligator Descartes and Tim Bunce. =260 \\$aCmabridge, MA :$bO'Reilly,$c2000. =263 \\$a1111 =300 \\$ap. cm. =650 \0$aPerl (Computer program language) =650 \0$aDatabase management. =700 1\$aBunce, Tim. =LDR 00605cam 22002054a 4500 =001 fol05843555\ =003 IMchF =005 20000525142739.0 =008 000318s1999\\\\cau\\\\\\b\\\\001\0\eng\\ =010 \\$a 00501349 =040 \\$aDLC$cDLC$dDLC =042 \\$apcc =050 00$aQA76.73.P22$bB763 1999 =082 00$a005.13/3$221 =100 1\$aBrown, Martin C. =245 10$aPerl :$bprogrammer's reference /$cMartin C. Brown. =260 \\$aBerkeley :$bOsborne/McGraw-Hill,$cc1999. =300 \\$axix, 380 p. ;$c22 cm. =504 \\$aIncludes bibliographical references and index. =650 \0$aPerl (Computer program language) =LDR 00579cam 22002054a 4500 =001 fol05843579\ =003 IMchF =005 20000525142716.0 =008 000318s1999\\\\caua\\\\\\\\\\001\0\eng\\ =010 \\$a 00502116 =020 \\$a0072120002 =040 \\$aDLC$cDLC$dDLC =042 \\$apcc =050 00$aQA76.73.P22$bB762 1999 =082 00$a005.13/3$221 =100 1\$aBrown, Martin C. =245 10$aPerl :$bthe complete reference /$cMartin C. Brown. =260 \\$aBerkeley :$bOsborne/McGraw-Hill,$cc1999. =300 \\$axxxv, 1179 p. :$bill. ;$c24 cm. =650 \0$aPerl (Computer program language) =LDR 00801nam 22002778a 4500 =001 fol05848297\ =003 IMchF =005 20000524125727.0 =008 000518s2000\\\\mau\\\\\\\\\\\001\0\eng\\ =010 \\$a 00041664 =020 \\$a1565924193 =040 \\$aDLC$cDLC =042 \\$apcc =050 00$aQA76.73.P22$bG84 2000 =082 00$a005.2/762$221 =100 1\$aGuelich, Scott. =245 10$aCGI programming with Perl /$cScott Guelich, Shishir Gundavaram & Gunther Birznieks. =250 \\$a2nd ed., expanded & updated =260 \\$aCambridge, Mass. :$bO'Reilly,$c2000. =263 \\$a0006 =300 \\$ap. cm. =650 \0$aPerl (Computer program language) =650 \0$aCGI (Computer network protocol) =650 \0$aInternet programming. =700 1\$aGundavaram, Shishir. =700 1\$aBirznieks, Gunther. =LDR 00665nam 22002298a 4500 =001 fol05865950\ =003 IMchF =005 20000615103017.0 =008 000612s2000\\\\mau\\\\\\\\\\\100\0\eng\\ =010 \\$a 00055759 =020 \\$a0596000138 =040 \\$aDLC$cDLC =042 \\$apcc =050 00$aQA76.73.P22$bP475 2000 =082 00$a005.13/3$221 =111 2\$aPerl Conference 4.0$d(2000 :$cMonterey, Calif.) =245 10$aProceedings of the Perl Conference 4.0 :$bJuly 17-20, 2000, Monterey, California. =250 \\$a1st ed. =260 \\$aCambridge, Mass. :$bO'Reilly,$c2000. =263 \\$a0006 =300 \\$ap. cm. =650 \0$aPerl (Computer program language)$vCongresses. =LDR 00579nam 22002178a 4500 =001 fol05865956\ =003 IMchF =005 20000615102948.0 =008 000612s2000\\\\mau\\\\\\\\\\\000\0\eng\\ =010 \\$a 00055770 =020 \\$a1565926099 =040 \\$aDLC$cDLC =042 \\$apcc =050 00$aQA76.73.P22$bB43 2000 =082 00$a005.13/3$221 =100 1\$aBlank-Edelman, David N. =245 10$aPerl for system administration /$cDavid N. Blank-Edelman. =260 \\$aCambridge, Mass. :$bO'Reilly,$c2000. =263 \\$a0006 =300 \\$ap. cm. =650 \0$aPerl (Computer program language) =LDR 00661nam 22002538a 4500 =001 fol05865967\ =003 IMchF =005 20000615102611.0 =008 000614s2000\\\\mau\\\\\\\\\\\000\0\eng\\ =010 \\$a 00055799 =020 \\$a0596000278 =040 \\$aDLC$cDLC =042 \\$apcc =050 00$aQA76.73.P22$bW35 2000 =082 00$a005.13/3$221 =100 1\$aWall, Larry. =245 10$aProgramming Perl /$cLarry Wall, Tom Christiansen & Jon Orwant. =250 \\$a3rd ed. =260 \\$aCambridge, Mass. :$bO'Reilly,$c2000. =263 \\$a0007 =300 \\$ap. cm. =650 \0$aPerl (Computer program language) =700 1\$aChristiansen, Tom. =700 1\$aOrwant, Jon. =LDR 00603cam 22002054a 4500 =001 fol05872355\ =003 IMchF =005 20000706095105.0 =008 000315s1999\\\\njua\\\\\\\\\\001\0\eng\\ =010 \\$a 00500678 =020 \\$a013020868X =040 \\$aDLC$cDLC$dDLC =042 \\$apcc =050 00$aQA76.73.P22$bL69 1999 =082 00$a005.13/3$221 =100 1\$aLowe, Vincent$q(Vincent D.) =245 10$aPerl programmer's interactive workbook /$cVincent Lowe. =260 \\$aUpper Saddle River, NJ :$bPrentice Hall PTP,$cc1999. =300 \\$axx, 633 p. :$bill. ;$c23 cm. =650 \0$aPerl (Computer program language) =LDR 00696nam 22002538a 4500 =001 fol05882032\ =003 IMchF =005 20000707091904.0 =008 000630s2000\\\\cau\\\\\\\\\\\001\0\eng\\ =010 \\$a 00058174 =020 \\$a0764547291 (alk. paper) =040 \\$aDLC$cDLC =042 \\$apcc =050 00$aQA76.73.P22$bF64 2000 =082 00$a005.13/3$221 =100 2\$aFoster-Johnson, Eric. =245 10$aCross-platform Perl /$cEric F. Johnson. =260 \\$aFoster City, CA :$bIDG Books Worldwide,$c2000. =263 \\$a0009 =300 \\$ap. cm. =500 \\$aIncludes index. =650 \0$aPerl (Computer program language) =650 \0$aWeb servers. =650 \0$aCross-platform software development. $inchar{phono} =MARC-File-MARCMaker-0.05/t/camel.usmarc 644 0 0 14677 10331114307 12274 00755cam 22002414a 4500001001300000003000600013005001700019008004100036010001700077020004300094040001800137042000800155050002600163082001700189100003100206245005400237260004200291300007200333500003300405650003700438630002500475630001300500fol05731351 IMchF20000613133448.0000107s2000 nyua 001 0 eng  a 00020737  a0471383147 (paper/cd-rom : alk. paper) aDLCcDLCdDLC apcc00aQA76.73.P22bM33 200000a005.13/32211 aMartinsson, Tobias,d1976-10aActivePerl with ASP and ADO /cTobias Martinsson. aNew York :bJohn Wiley & Sons,c2000. axxi, 289 p. :bill. ;c23 cm. +e1 computer laser disc (4 3/4 in.) a"Wiley Computer Publishing." 0aPerl (Computer program language)00aActive server pages.00aActiveX.00647pam 2200241 a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001800109042000800127050002600135082001500161100002600176245006700202260003800269263000900307300001100316650003700327650002500364700001600389fol05754809 IMchF20000601115601.0000203s2000 mau 001 0 eng  a 00022023  a1565926994 aDLCcDLCdDLC apcc00aQA76.73.P22bD47 200000a005.742211 aDescartes, Alligator.10aProgramming the Perl DBI /cAlligator Descartes and Tim Bunce. aCmabridge, MA :bO'Reilly,c2000. a1111 ap. cm. 0aPerl (Computer program language) 0aDatabase management.1 aBunce, Tim.00605cam 22002054a 4500001001300000003000600013005001700019008004100036010001700077040001800094042000800112050002700120082001700147100002100164245005500185260004500240300002600285504005100311650003700362fol05843555 IMchF20000525142739.0000318s1999 cau b 001 0 eng  a 00501349  aDLCcDLCdDLC apcc00aQA76.73.P22bB763 199900a005.13/32211 aBrown, Martin C.10aPerl :bprogrammer's reference /cMartin C. Brown. aBerkeley :bOsborne/McGraw-Hill,cc1999. axix, 380 p. ;c22 cm. aIncludes bibliographical references and index. 0aPerl (Computer program language)00579cam 22002054a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001800109042000800127050002700135082001700162100002100179245005500200260004500255300003600300650003700336fol05843579 IMchF20000525142716.0000318s1999 caua 001 0 eng  a 00502116  a0072120002 aDLCcDLCdDLC apcc00aQA76.73.P22bB762 199900a005.13/32211 aBrown, Martin C.10aPerl :bthe complete reference /cMartin C. Brown. aBerkeley :bOsborne/McGraw-Hill,cc1999. axxxv, 1179 p. :bill. ;c24 cm. 0aPerl (Computer program language)00801nam 22002778a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002600130082001800156100002000174245008800194250003200282260004100314263000900355300001100364650003700375650003600412650002600448700002500474700002400499fol05848297 IMchF20000524125727.0000518s2000 mau 001 0 eng  a 00041664  a1565924193 aDLCcDLC apcc00aQA76.73.P22bG84 200000a005.2/7622211 aGuelich, Scott.10aCGI programming with Perl /cScott Guelich, Shishir Gundavaram & Gunther Birznieks. a2nd ed., expanded & updated aCambridge, Mass. :bO'Reilly,c2000. a0006 ap. cm. 0aPerl (Computer program language) 0aCGI (Computer network protocol) 0aInternet programming.1 aGundavaram, Shishir.1 aBirznieks, Gunther.00665nam 22002298a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002700130082001700157111005200174245008600226250001200312260004100324263000900365300001100374650005000385fol05865950 IMchF20000615103017.0000612s2000 mau 100 0 eng  a 00055759  a0596000138 aDLCcDLC apcc00aQA76.73.P22bP475 200000a005.13/32212 aPerl Conference 4.0d(2000 :cMonterey, Calif.)10aProceedings of the Perl Conference 4.0 :bJuly 17-20, 2000, Monterey, California. a1st ed. aCambridge, Mass. :bO'Reilly,c2000. a0006 ap. cm. 0aPerl (Computer program language)vCongresses.00579nam 22002178a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002600130082001700156100002800173245006200201260004100263263000900304300001100313650003700324fol05865956 IMchF20000615102948.0000612s2000 mau 000 0 eng  a 00055770  a1565926099 aDLCcDLC apcc00aQA76.73.P22bB43 200000a005.13/32211 aBlank-Edelman, David N.10aPerl for system administration /cDavid N. Blank-Edelman. aCambridge, Mass. :bO'Reilly,c2000. a0006 ap. cm. 0aPerl (Computer program language)00661nam 22002538a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002600130082001700156100001700173245006700190250001200257260004100269263000900310300001100319650003700330700002300367700001700390fol05865967 IMchF20000615102611.0000614s2000 mau 000 0 eng  a 00055799  a0596000278 aDLCcDLC apcc00aQA76.73.P22bW35 200000a005.13/32211 aWall, Larry.10aProgramming Perl /cLarry Wall, Tom Christiansen & Jon Orwant. a3rd ed. aCambridge, Mass. :bO'Reilly,c2000. a0007 ap. cm. 0aPerl (Computer program language)1 aChristiansen, Tom.1 aOrwant, Jon.00603cam 22002054a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001800109042000800127050002600135082001700161100003200178245006000210260005700270300003300327650003700360fol05872355 IMchF20000706095105.0000315s1999 njua 001 0 eng  a 00500678  a013020868X aDLCcDLCdDLC apcc00aQA76.73.P22bL69 199900a005.13/32211 aLowe, Vincentq(Vincent D.)10aPerl programmer's interactive workbook /cVincent Lowe. aUpper Saddle River, NJ :bPrentice Hall PTP,cc1999. axx, 633 p. :bill. ;c23 cm. 0aPerl (Computer program language)00696nam 22002538a 4500001001300000003000600013005001700019008004100036010001700077020002800094040001300122042000800135050002600143082001700169100002600186245004400212260005100256263000900307300001100316500002000327650003700347650001700384650004100401fol05882032 IMchF20000707091904.0000630s2000 cau 001 0 eng  a 00058174  a0764547291 (alk. paper) aDLCcDLC apcc00aQA76.73.P22bF64 200000a005.13/32212 aFoster-Johnson, Eric.10aCross-platform Perl /cEric F. Johnson. aFoster City, CA :bIDG Books Worldwide,c2000. a0009 ap. cm. aIncludes index. 0aPerl (Computer program language) 0aWeb servers. 0aCross-platform software development.h, Scott. =245 10$aCGI programming with Perl /$cScott Guelich, SMARC-File-MARCMaker-0.05/t/marcmaker.t 644 0 0 25715 10331114307 12121 #!perl =head1 NAME marcmaker.t -- Tests for MARC::File::MARCMaker. =head1 TO DO Compare decoded and encoded versions of records in camel.mrk and camel.usmarc with each other. Determine how to link as_marcmaker method from MARC::File::MARCMaker to MARC::Field without "only once" warning. More comprehensive tests of character encoding/decoding. =cut use strict; use warnings; use Test::More tests=>10; BEGIN { use_ok( 'MARC::Batch' ); } BEGIN { use_ok( 'MARC::File::USMARC' ); } BEGIN { use_ok( 'MARC::File::MARCMaker' ); } if (UNIVERSAL::can('MARC::Field', 'as_marcmaker')) { warn "MARC::Field now has an as_marcmaker() method"; } else { no warnings; *MARC::Field::as_marcmaker = *MARC::File::MARCMaker::as_marcmaker; } ################################################### ################################################### #create MARC::Record object for manipulation my $record = MARC::Record->new(); isa_ok( $record, 'MARC::Record', 'MARC record' ); $record->leader("00000nam 2200253 a 4500"); my $nfields = $record->add_fields( #control number so one is present ['001', "ttt05000001" ], #basic 008 ['008', "050801s2005 ilu 000 0 eng d" ], #basic 245 [245, "0","0", a => "Test record from text /", c => "Bryan Baldus ... [et al.].", ], [500, '', '', a => 'This is a test of ordinary features like replacement of the mnemonics for currency and dollar signs ($) and backslashes (backsolidus \ ) used for blanks in certain areas.' ], [500, '', '', a => 'This is a test for the conversion of curly braces; the opening curly brace ( { ) and the closing curly brace ( } ).' ], [500, '', '', a => "This is a test of diacritics like the uppercase Polish L in odz, the uppercase Scandinavia O in st, the uppercase D with crossbar in uro, the uppercase Icelandic thorn in ann, the uppercase digraph AE in gir, the uppercase digraph OE in uvres, the soft sign in rech, the middle dot in colleccio, the musical flat in F, the patent mark in Frizbee, the plus or minus sign in 54%, the uppercase O-hook in B, the uppercase U-hook in XA, the alif in masalah, the ayn in arab, the lowercase Polish l in Wocaw, the lowercase Scandinavian o in Kbenhavn, the lowercase d with crossbar in avola, the lowercase Icelandic thorn in ann, the lowercase digraph ae in vre, the lowercase digraph oe in cur, the lowercase hardsign in sezd, the Turkish dotless i in masal, the British pound sign in 5.95, the lowercase eth in verur, the lowercase o-hook (with pseudo question mark) in S, the lowercase u-hook in T Dc, the pseudo question mark in cui, the grave accent in tres, the acute accent in desiree, the circumflex in cote, the tilde in manana, the macron in Tokyo, the breve in russkii, the dot above in zaba, the dieresis (umlaut) in Lowenbrau, the caron (hachek) in crny, the circle above (angstrom) in arbok, the ligature first and second halves in diadia, the high comma off center in rozdelovac, the double acute in idoszaki, the candrabindu (breve with dot above) in Aliiev, the cedilla in ca va comme ca, the right hook in vieta, the dot below in teda, the double dot below in khutbah, the circle below in Samskrta, the double underscore in Ghulam, the left hook in Lech Waesa, the right cedilla (comma below) in khong, the upadhmaniya (half circle below) in humantus, double tilde, first and second halves in ngalan, high comma (centered) in geotermika.", ], [650, '', '0', a => 'MARC records.', ], ); is( $nfields, 7, "All the fields added OK" ); my @fields500 = $record->field('500'); is($fields500[0]->as_marcmaker(), "=500 \\\\\$aThis is a test of ordinary features like replacement of the mnemonics for currency and dollar signs ({dollar}) and backslashes (backsolidus {bsol} ) used for blanks in certain areas.\n", join "\t", "Dollars and backslashes test ok", $fields500[0]->as_marcmaker()); is($fields500[1]->as_marcmaker(), "=500 \\\\\$aThis is a test for the conversion of curly braces; the opening curly brace ( {lcub} ) and the closing curly brace ( {rcub} ).\n", join "\t", "Curly braces test ok", $fields500[1]->as_marcmaker()); my $rec_as_maker = MARC::File::MARCMaker::encode($record); my $record_from_maker = MARC::File::MARCMaker::decode($rec_as_maker); isa_ok( $record_from_maker, 'MARC::Record', 'MARC record from MARCMaker data' ); my @recoded_500s = $record_from_maker->field('500'); print $recoded_500s[0]->as_string(), "\n"; print $recoded_500s[1]->as_string(), "\n"; ####################### ### Diacritics test ### ####################### is ($fields500[2]->as_marcmaker(), "=500 \\\\\$aThis is a test of diacritics like the uppercase Polish L in {Lstrok}{acute}od{acute}z, the uppercase Scandinavia O in {Ostrok}st, the uppercase D with crossbar in {Dstrok}uro, the uppercase Icelandic thorn in {THORN}ann, the uppercase digraph AE in {AElig}gir, the uppercase digraph OE in {OElig}uvres, the soft sign in rech{softsign}, the middle dot in col{middot}lecci{acute}o, the musical flat in F{flat}, the patent mark in Frizbee{reg}, the plus or minus sign in {plusmn}54%, the uppercase O-hook in B{Ohorn}, the uppercase U-hook in X{Uhorn}A, the alif in mas{mlrhring}alah, the ayn in {mllhring}arab, the lowercase Polish l in W{lstrok}oc{lstrok}aw, the lowercase Scandinavian o in K{ostrok}benhavn, the lowercase d with crossbar in {dstrok}avola, the lowercase Icelandic thorn in {thorn}ann, the lowercase digraph ae in v{aelig}re, the lowercase digraph oe in c{oelig}ur, the lowercase hardsign in s{hardsign}ezd, the Turkish dotless i in masal{inodot}, the British pound sign in {pound}5.95, the lowercase eth in ver{eth}ur, the lowercase o-hook (with pseudo question mark) in S{hooka}{ohorn}, the lowercase u-hook in T{uhorn} D{uhorn}c, the pseudo question mark in c{hooka}ui, the grave accent in tr{grave}es, the acute accent in d{acute}esir{acute}ee, the circumflex in c{circ}ote, the tilde in ma{tilde}nana, the macron in T{macr}okyo, the breve in russki{breve}i, the dot above in {dot}zaba, the dieresis (umlaut) in L{uml}owenbr{uml}au, the caron (hachek) in {caron}crny, the circle above (angstrom) in {ring}arbok, the ligature first and second halves in d{llig}i{rlig}ad{llig}i{rlig}a, the high comma off center in rozdel{rcommaa}ovac, the double acute in id{dblac}oszaki, the candrabindu (breve with dot above) in Ali{candra}iev, the cedilla in {cedil}ca va comme {cedil}ca, the right hook in viet{ogon}a, the dot below in te{dotb}da, the double dot below in {under}k{under}hu{dbldotb}tbah, the circle below in Sa{dotb}msk{ringb}rta, the double underscore in {dblunder}Ghulam, the left hook in Lech Wa{lstrok}{commab}esa, the right cedilla (comma below) in kh{rcedil}ong, the upadhmaniya (half circle below) in {breveb}humantu{caron}s, double tilde, first and second halves in {ldbltil}n{rdbltil}galan, high comma (centered) in g{commaa}eotermika.\n", "Diacritics to mnemonics ok."); is ($recoded_500s[2]->as_string(), "This is a test of diacritics like the uppercase Polish L in odz, the uppercase Scandinavia O in st, the uppercase D with crossbar in uro, the uppercase Icelandic thorn in ann, the uppercase digraph AE in gir, the uppercase digraph OE in uvres, the soft sign in rech, the middle dot in colleccio, the musical flat in F, the patent mark in Frizbee, the plus or minus sign in 54%, the uppercase O-hook in B, the uppercase U-hook in XA, the alif in masalah, the ayn in arab, the lowercase Polish l in Wocaw, the lowercase Scandinavian o in Kbenhavn, the lowercase d with crossbar in avola, the lowercase Icelandic thorn in ann, the lowercase digraph ae in vre, the lowercase digraph oe in cur, the lowercase hardsign in sezd, the Turkish dotless i in masal, the British pound sign in 5.95, the lowercase eth in verur, the lowercase o-hook (with pseudo question mark) in S, the lowercase u-hook in T Dc, the pseudo question mark in cui, the grave accent in tres, the acute accent in desiree, the circumflex in cote, the tilde in manana, the macron in Tokyo, the breve in russkii, the dot above in zaba, the dieresis (umlaut) in Lowenbrau, the caron (hachek) in crny, the circle above (angstrom) in arbok, the ligature first and second halves in diadia, the high comma off center in rozdelovac, the double acute in idoszaki, the candrabindu (breve with dot above) in Aliiev, the cedilla in ca va comme ca, the right hook in vieta, the dot below in teda, the double dot below in khutbah, the circle below in Samskrta, the double underscore in Ghulam, the left hook in Lech Waesa, the right cedilla (comma below) in khong, the upadhmaniya (half circle below) in humantus, double tilde, first and second halves in ngalan, high comma (centered) in geotermika.", "Diacritics test ok"); #=500 \\$aThis is a test of diacritics like the uppercase Polish L in {Lstrok}{acute}od{acute}z, the uppercase Scandinavia O in {Ostrok}st, the uppercase D with crossbar in {Dstrok}uro, the uppercase Icelandic thorn in {THORN}ann, the uppercase digraph AE in {AElig}gir, the uppercase digraph OE in {OElig}uvres, the soft sign in rech{softsign}, the middle dot in col{middot}lecci{acute}o, the musical flat in F{flat}, the patent mark in Frizbee{reg}, the plus or minus sign in {plusmn}54%, the uppercase O-hook in B{Ohorn}, the uppercase U-hook in X{Uhorn}A, the alif in mas{mlrhring}alah, the ayn in {mllhring}arab, the lowercase Polish l in W{lstrok}oc{lstrok}aw, the lowercase Scandinavian o in K{ostrok}benhavn, the lowercase d with crossbar in {dstrok}avola, the lowercase Icelandic thorn in {thorn}ann, the lowercase digraph ae in v{aelig}re, the lowercase digraph oe in c{oelig}ur, the lowercase hardsign in s{hardsign}ezd, the Turkish dotless i in masal{inodot}, the British pound sign in {pound}5.95, the lowercase eth in ver{eth}ur, the lowercase o-hook (with pseudo question mark) in S{hooka}{ohorn}, the lowercase u-hook in T{uhorn} D{uhorn}c, the pseudo question mark in c{hooka}ui, the grave accent in tr{grave}es, the acute accent in d{acute}esir{acute}ee, the circumflex in c{circ}ote, the tilde in ma{tilde}nana, the macron in T{macr}okyo, the breve in russki{breve}i, the dot above in {dot}zaba, the dieresis (umlaut) in L{uml}owenbr{uml}au, the caron (hachek) in {caron}crny, the circle above (angstrom) in {ring}arbok, the ligature first and second halves in d{llig}i{rlig}ad{llig}i{rlig}a, the high comma off center in rozdel{rcommaa}ovac, the double acute in id{dblac}oszaki, the candrabindu (breve with dot above) in Ali{candra}iev, the cedilla in {cedil}ca va comme {cedil}ca, the right hook in viet{ogon}a, the dot below in te{dotb}da, the double dot below in {under}k{under}hu{dbldotb}tbah, the circle below in Sa{dotb}msk{ringb}rta, the double underscore in {dblunder}Ghulam, the left hook in Lech Wa{lstrok}{commab}esa, the right cedilla (comma below) in kh{rcedil}ong, the upadhmaniya (half circle below) in {breveb}humantu{caron}s, double tilde, first and second halves in {ldbltil}n{rdbltil}galan, high comma (centered) in g{commaa}eotermika. cord' ); $record->leader("00000nam 2200253 a 4500sical flat in F, the patent mark in Frizbee, the plus or minus sign in 54%, the uppercase O-hook in B, the uppercase U-hook in XA, the alif in masalah, the ayn in arab, the lowercase Polish l in Wocaw, the lowercase Scandinavian o in Kbenhavn, the lowercase d with crossbar in avola, the lowercase Icelandic thorn in ann, the lowercase digraph ae in vre, the lowercase digraph oe in cur, the lowercase hardsign in sezd, the Turkish dotless i in masal, the British pound sign in 5.95, the lowercase eth in verur, the lowercase o-hook (with pseudo question mark) in S, the lowercase u-hook in T Dc, the pseudo question mark in cui, the grave accent in tres, the acute accent in desiree, the circumflex in cote, the tilde in manana, the macron in Tokyo, the breve in russkii, the dot above in zaba, the dieresis (umlaut) in Lowenbrau, the caron (hachek) in crny, the circle above (angstrom) in arbok, the ligature first and second halves in diadia, the high comma off center in rozdelovac, the double acute in idoszaki, the candrabindu (breve with dot above) in Aliiev, the cedilla in ca va comme ca, the right hook in vieta, the dot below in teda, the double dot below in khutbah, the circle below in Samskrta, the double underscore in Ghulam, the left hook in Lech Waesa, the right cedilla (comma below) in khong, the upadhmaniya (half circle below) in humantus, double tilde, first and second halves in ngalan, high comma (centered) in geotermika.", ], [650, '', '0', a => 'MARC records.', ], ); is( $nfields, 7, "All the fields added OK" ); my @fields500 = $record->field('500'); is($fields500[0]->as_marcmaker(), "=500 \\\\\$aThis is a test of ordinary features like replacement of the mnemonics for currency and dollar signs ({dollar}) and backslashes (backsolidus {bsol} ) used for blanks in certain areas.\n", join "\t", "Dollars and backslashes test ok", $fields500[0]->as_marcmaker()); is($fields500[1]->as_marcmaker(), "=500 \\\\\$aThis is a test for the conversion of curly braces; the opening curly brace ( {lcub} ) and the closing curly brace ( {rcub} ).\n", join "\t", "Curly braces test ok", $fields500[1]->as_marcmaker()); my $rec_as_maker = MARC::File::MARCMaker::encode($record); my $record_from_maker = MARC::File::MARCMaker::decode($rec_as_maker); isa_ok( $record_from_maker, 'MARC::Record', 'MARC record from MARCMaker data' ); my @recoded_500s = $record_from_maker->field('500'); print $recoded_500s[0]->as_string(), "\n"; print $recoded_500s[1]->as_string(), "\n"; ####################### ### Diacritics test ### ####################### is ($fields500[2]->as_marcmaker(), "=500 \\\\\$aThis is a test of diacritics like the uppercase Polish L in {Lstrok}{acute}od{acute}z, the uppercase Scandinavia O in {Ostrok}st, the uppercase D with crossbar in {Dstrok}uro, the uppercase Icelandic thorn in {THORN}ann, the uppercase digraph AE in {AElig}gir, the uppercase digraph OE in {OElig}uvres, the soft sign in rech{softsign}, the middle dot in col{middot}lecci{acute}o, the musical flat in F{flat}, the patent mark in Frizbee{reg}, the plus or minus sign in {plusmn}54%, the uppercase O-hook in B{Ohorn}, the uppercase U-hook in X{Uhorn}A, the alif in mas{mlrhring}alah, the ayn in {mllhring}arab, the lowercase Polish l in W{lstrok}oc{lstrok}aw, the lowercase Scandinavian o in K{ostrok}benhavn, the lowercase d with crossbar in {dstrok}avola, the lowercase Icelandic thorn in {thorn}ann, the lowercase digraph ae in v{aelig}re, the lowercase digraph oe in c{oelig}ur, the lowercase hardsign in s{hardsign}ezd, the Turkish dotless i in masal{inodot}, the British pound sign in {pound}5.95, the lowercase eth in ver{eth}ur, the lowercase o-hook (with pseudo question mark) in S{hooka}{ohorn}, the lowercase u-hook in T{uhorn} D{uhorn}c, the pseudo question mark in c{hooka}ui, the grave accent in tr{grave}es, the acute accent in d{acute}esir{acute}ee, the circumflex in c{circ}ote, the tilde in ma{tilde}nana, the macron in T{macr}okyo, the breve in russki{breve}i, the dot above in {dot}zaba, the dieresis (umlaut) in L{uml}owenbr{uml}au, the caron (hachek) in {caron}crny, the circle above (angstrom) in {ring}arbok, the ligature first and second halves in d{llig}i{rlig}ad{llig}i{rlig}a, the high comma off center in rozdel{rcommaa}ovac, the double acute in id{dblac}oszaki, the candrabindu (breve with dot above) in Ali{candra}iev, the cedilla in {cedil}ca va comme {cedil}ca, the right hook in viet{ogon}a, the dot below in te{dotb}da, the double dot below in {under}k{under}hu{dbldotb}tbah, the circle below in Sa{dotb}msk{ringb}rta, the double underscore in {dblunder}Ghulam, the left hook in Lech Wa{lstrok}{commab}esa, the right cedilla (comma below) in kh{rcedil}ong, the upadhmaniya (half circle below) in {breveb}humantu{caron}s, double tilde, first and second halves in {ldbltil}n{rdbltil}galan, high comma (centered) in g{commaa}eotermika.\n", "Diacritics to mnemonics ok."); is ($recoded_500s[2]->as_string(), "This is a test of diacritics like the uppercase Polish L in odz, the uppercase Scandinavia O in st, the uppercase D with crossbar in uro, the uppercase Icelandic thorn in ann, the uppercase digraph AE in gir, the uppercase digraph OE in uvres, the soft sign in rech, the middle dot in colleccio, the musical flat in F, the patent mark in Frizbee, the plus or minus sign in 54%, the uppercase O-hook in B, the uppercase U-hook in XA, the alif in masalah, the ayn in arab, the lowercase Polish l in Wocaw, the lowercase Scandinavian o in Kbenhavn, the lowercase d with crossbar in avola, the lowercase Icelandic thorn in ann, the lowercase digraph ae in vre, the lowercase digraph oe in cur, the lowercase hardsign in sezd, the Turkish dotless i in masal, the British pound sign in 5.95, the lowercase eth in verur, the lowercase o-hook (with pseudo question mark) in S, the lowercase u-hook in T Dc, the pseudo question mark in cui, the grave accent in tres, the acute accent in desiree, the circumflex in cote, the tilde in manana, the macron in Tokyo, the breve in russkii, the dot above in zaba, the dieresis (umlaut) in Lowenbrau, the caron (hachek) in crny, the circle above (angstrom) in arbok, the ligature first and second halves in diadia, the high comma off center in rozdelovac, the double acute in idoszaki, the candrabindu (breve with dot above) in Aliiev, the cedilla in ca va comme ca, the right hook in vieta, the dot below in teda, the double dot below in khutbah, the circle below in Samskrta, the double underscore in Ghulam, the left hook in Lech Waesa, the right cedilla (comma below) in khong, the upadhmaniya (half circle below) in humantus, double tilde, first and second halves in ngalan, high comma (centered) in geotermika.", "Diacritics test ok"); #=500 \\$aThis is a test of diacritics like the uppercase Polish L in {Lstrok}{acute}od{acute}z, the uppercase Scandinavia O in {Ostrok}st, the uppercase D with crossbar in {Dstrok}uro, the uppercase Icelandic thorn in {THORN}ann, the uppercase digraph AE in {AElig}gir, the uppercase digraph OE in {OElig}uvres, the soft sign in rech{softsign}, the middle dot in col{middot}lecci{acute}o, the musical flat in F{flat}, the patent mark in Frizbee{reg}, the plus or minus sign in {plusmn}54%, the uppercase O-hook in B{Ohorn}, the uppercase U-hook in X{Uhorn}A, the alif in mas{mlrhring}alah, the ayn in {mllhring}arab, the lowercase Polish l in W{lstrok}oc{lstrok}aw, the lowercase Scandinavian o in K{ostrok}benhavn, the lowercase d with crossbar in {dstrok}avola, the lowercase Icelandic thorn in {thorn}ann, the lowercase digraph ae in v{aelig}re, the lowercase digraph oe in c{oelig}ur, the lowercase hardsign in s{hardsign}ezd, the Turkish dotless i in masal{inodot}, the British pound sign in {pound}5.95, the lowercase eth in ver{eth}ur, the lowercase o-hook (with pseudo question mark) in S{hooka}{ohorn}, the lowercase u-hook in T{uhorn} D{uhorn}c, the pseudo question mark in c{hooka}ui, the grave accent in tr{grave}es, the acute accent in d{acute}esir{acute}ee, the circumflex in c{circ}ote,