Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Turning string into MARC record

5 views
Skip to first unread message

arvinp...@lycos.com

unread,
Aug 2, 2012, 1:17:24 PM8/2/12
to perl...@perl.org
This seems like such a stupid question - I've used MARC::Batch for years - but how do you turn a MARC record string into a MARC::Record object?

I've always started with a file of MARC records and cycle through them with MARC::Batch. Now I have a single MARC record in a string - no file, it's retrieved by Z39.50. I could have sworn I've done this before but I can't find anything in the documentation. Do I have to somehow assign it to a file handle à la "open (MARC, '<', \$rawmarc);" and pass that it in to MARC::Batch? I'm willing to do that but I really could swear there was a simpler way to do it, avoiding MARC::Batch altogether.

Arvin

arvinp...@lycos.com

unread,
Aug 2, 2012, 1:46:00 PM8/2/12
to perl...@perl.org
My response to you got bounced by the list too. So I'm resending to the list for all to see.

my $record = MARC::File::USMARC->decode( $marc_string)  is pretty clear. I'll use that.

Thanks again!

>On Aug 2, 2012, Gorman, Jon wrote:

>The docs are pointing to the method

>my $record = MARC::File::USMARC->decode( $marc_string) ;

>which should work as well. The other use is probably "deprecated" but I don't think it's going away.

>(Doh, forgot that this email address is messed up with the listserv and it bounces the message. Well, at least you got the mail ;).


Jon G.

> -----Original Message-----
> From: arvinp...@lycos.com [mailto:arvinp...@lycos.com]
> Sent: Thursday, August 02, 2012 12:30 PM
> To: Gorman, Jon
> Cc: perl...@perl.org
> Subject: Re: RE: Turning string into MARC record
>
> Thanks for the speedy reply! I saw that in documentation but I didn't know
> what a "marcblob" was (to me a blob is a database term). Also it says "for
> compatibility with older versions of MARC::Record" so I was thinking using
> that was deprecated anyway.
>
> Thanks again!
>
> Arvin
>
>
>
> On Aug 2, 2012, Gorman, Jon wrote:
>
> No need to use MARC::Batch in this case, just use the
> new_from_usmarc method in MARC::Record
>
>
> my $record = MARC::Record->new_from_usmarc( $record_string ) ;
>
> Jon Gorman
> University of Illinois

Gorman, Jon

unread,
Aug 2, 2012, 1:20:06 PM8/2/12
to arvinp...@lycos.com, perl...@perl.org
No need to use MARC::Batch in this case, just use the new_from_usmarc method in MARC::Record


my $record = MARC::Record->new_from_usmarc( $record_string ) ;

Jon Gorman
University of Illinois

> -----Original Message-----
> From: arvinp...@lycos.com [mailto:arvinp...@lycos.com]
> Sent: Thursday, August 02, 2012 12:17 PM
> To: perl...@perl.org
> Subject: Turning string into MARC record
>

Gorman, Jon

unread,
Aug 2, 2012, 1:34:12 PM8/2/12
to arvinp...@lycos.com, perl...@perl.org

The docs are pointing to the method

my $record = MARC::File::USMARC->decode( $marc_string) ;

which should work as well. The other use is probably "deprecated" but I don't think it's going away.

(Doh, forgot that this email address is messed up with the listserv and it bounces the message. Well, at least you got the mail ;).


Jon G.

> -----Original Message-----
> From: arvinp...@lycos.com [mailto:arvinp...@lycos.com]
> Sent: Thursday, August 02, 2012 12:30 PM
> To: Gorman, Jon
> Cc: perl...@perl.org
> Subject: Re: RE: Turning string into MARC record
>
> Thanks for the speedy reply! I saw that in documentation but I didn't know
> what a "marcblob" was (to me a blob is a database term). Also it says "for
> compatibility with older versions of MARC::Record" so I was thinking using
> that was deprecated anyway.
>
> Thanks again!
>
> Arvin
>
>
>
0 new messages