MARC-Errorchecks

 view release on metacpan or  search on metacpan

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


=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

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.276 second using v1.01-cache-2.11-cpan-3b35f9de6a3 )