Using arrays instead of hashes in MARC::Field constructor
Whenever you’re creating a MARC field using Perl’s excelent MARC::Field module, you can always use an array instead of a hash in order to specify subfield/data pairs. This is useful since some field/subfield combinations in MARC are repeatable, and the POD leads you to writing hashes for storing subfield/data pairs before creating the field. For example, the POD says:
my $field = MARC::Field->new(
245, '1', '0',
'a' => 'Raccoons and ripe corn / ',
'c' => 'Jim Arnosky.'
);
But this is also valid and works:
my @array = ('a', 'Raccoons and ripe corn /', 'c', 'Jim Arnosky.', 'k', 'typescript, 'k', 'diaries');
my $field = MARC::Field->new ( 245 , '1', '0', @array );
0 Comments.