Thank you for your answer, Galen.

Unfortunately, my simple script does not work.
Here it is.
----------------------------------------------------------
#!/usr/bin/perl
use MARC::Record;
use MARC::Batch;
use MARC::File::XML ( BinaryEncoding => 'utf8', RecordFormat => 'USMARC' );

    my $filename =  "01al2008.mrf";
    my $batch = MARC::Batch->new('USMARC', $filename );
    my $record = $batch->next();
    print $record->as_xml()."\n";
----------------------------------------------------------
The error returned by my script is:
Can't call method "as_xml" on an undefined value at try.pl line 9.

I got the same result with the as_record_xml()

I suppose, $batch->next() does not return MARC::Record object.




2008/9/2 Galen Charlton <[EMAIL PROTECTED]>:
> Hi,
>
> On Tue, Sep 2, 2008 at 5:33 AM, Dmitry Arsentiev <[EMAIL PROTECTED]> wrote:
>> The question #1: Would it be right to develop my scripts with MARC.pm
>> and MARC::XML.pm,
>>                         or I should to develop only with MARC::Record
>
> I'd recommend using MARC::Record and MARC::File::XML.
>
>> The question #2: If  I should to develop MARC::Record-based script,
>>                         can I easy convert from MARC to MARCXML,
>>                         or I've to write handler for each field I got
>> from MARC?
>
> It can be as easy as loading a MARC record into a MARC::Record object
> (e.g., $marc), then using the output of $marc->as_xml() or
> $marc->as_xml_record().
>
> Regards,
>
> Galen
> --
> Galen Charlton
> VP, Research & Development, LibLime
> [EMAIL PROTECTED]
> p: 1-888-564-2457 x709
> skype: gmcharlt
>

Reply via email to