Hi Leif and Jon,

> use MARC::Record;
> ...
> my $record = MARC::Record->new_from_usmarc( $blob );

This works!

> From: Jon Gorman [mailto:[email protected]]
> Sent: Friday, January 07, 2011 7:51 AM
> You'll probably think of this when you get up, but did you make sure
> to import the package? ie use MARC::FILE::USMARC;?

This made the other way work, too! (I had only "use MARC::File")

Much thanks to Leif and Jon.

-- Michael

# Michael Doran, Systems Librarian
# University of Texas at Arlington
# 817-272-5326 office
# 817-688-1926 mobile
# [email protected]
# http://rocky.uta.edu/doran/
 
> -----Original Message-----
> From: Leif Andersson [mailto:[email protected]]
> Sent: Friday, January 07, 2011 7:50 AM
> To: Doran, Michael D; perl4lib
> Subject: Re: MARC blob to MARC::Record object
> 
> Hi Michael,
> 
> this is how I - in principle - usually do it:
> 
> use MARC::Record;
> ...
> my $record = MARC::Record->new_from_usmarc( $blob );
> 
> /Leif
> 
> Leif Andersson, Systems librarian
> Stockholm University Library
> ________________________________________
> Från: Doran, Michael D [[email protected]]
> Skickat: den 7 januari 2011 00:18
> Till: perl4lib
> Ämne: MARC blob to MARC::Record object
> 
> I am working on a Perl script that retrieves data from our Voyager ILS via an
> SQL query.  Among other data, I have MARC records in blob form, and the script
> processes one MARC record at a time.  I want to be able to parse and
> modify/convert the MARC record (using MARC::Record) before writing/printing
> data to a file.
> 
> How do I make the MARC blob into a MARC::Record object (without having to
> first save it a file and read it in with MARC::File/Batch)?  The MARC blob is
> already in a variable, so it doesn't make sense (to me) to write it out to a
> file just so I can read it back in.  Unless I have to, natch.
> 
> I apologize if I am missing something obvious.
> 
> -- Michael
> 
> # Michael Doran, Systems Librarian
> # University of Texas at Arlington
> # 817-272-5326 office
> # 817-688-1926 mobile
> # [email protected]
> # http://rocky.uta.edu/doran/

Reply via email to