zhumao

新手上路

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

#!/usr/bin/perl

## create a MARC::Record object.
use MARC::Record;
my $record = MARC::Record->new();

## add the leader to the record. optional.
$record->leader('00903pam   2200265 a 4500');

## create an author field.
my $author = MARC::Field->new('100',1,'',a => 'Logan, Robert K.',d => '1939-');
## create a title field.
my $title = MARC::Field->new('245','1','4',a => 'The alphabet effect /',c => 'Robert K. Logan.');
$record->append_fields($author, $title);
## open a filehandle to write to 'record.dat'.
open(OUTPUT, '> record.dat') or die $!;
print OUTPUT $record->as_usmarc();
close(OUTPUT);

posted on 2005-08-11 22:06  zhumao-2  阅读(581)  评论(0编辑  收藏  举报