MARC-Errorchecks

 view release on metacpan or  search on metacpan

lib/MARC/BBMARC.pm  view on Meta::CPAN

241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
=head2 updated_record_array()
 
Note: Creates an array of control numbers (001) from input file.
Use with merge marc script. Call to initialize updated record array variable prior to entering loop.
Prompts for updated record file.
Prints running count of records based on counting_print function. Works only with USMARC input files.
 
=cut
 
sub updated_record_array {
 
        use MARC::File::USMARC;
        my @updatedrecarray;
####################################
# To do: test abstracted input file call ##
####################################
        my $inputfile = shift;
        unless ($inputfile) {
                print ("What is the updated record file?:");
                $inputfile = <>;

lib/MARC/BBMARC.pm  view on Meta::CPAN

637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
This may be very memory intensive as it stores raw MARC for each record in the updated (first) file, with its associated control number.
40000+ records (43815K on disk) take approximately 102,192K+ to read in and then dereference.
YOU HAVE BEEN WARNED!!!
 
=head2 TO DO (on updated_record_hash)
 
Reduce memory usage, probably by learning how to tie hash to file instead of storing everything in memory.
 
=cut
 
sub updated_record_hash {
 
        use MARC::Batch;
        my %updatedrechash;
 
        #retrieve file name if one was passed
        my $inputfile = shift;
        #otherwise get file name
        unless ($inputfile) {
                print ("What is the updated record file?:");
                $inputfile = <>;



( run in 0.612 second using v1.01-cache-2.11-cpan-49f99fa48dc )