Re: Seekign help with MARC.pm ->as_string

[email protected] ("Saiful Amin")
Newsgroups perl.perl4lib
Message-ID <[email protected]>
Hi Migell,

As per your script '$phys_format' is a subfield (line 146), which is nothing
but text. The function 'as_string()' can be used only for field objects, not
subfields. So, your line 153 should read:

    if($phys_format =~ /Paperback/i ){     # Ignore the case sensitivity
using 'i' switch

Hope this helps.

Regards,
Saiful

On Tue, Apr 15, 2008 at 6:39 AM, Migell Acosta <[email protected]>
wrote:

> Hello all,
>
> I am working on a script that will take a MARC record from Baker and
> Taylor's Title Source and pre-process it so that I can use it in SirsiDynix
> Symphony 9XX loader - which takes MARC records and converts them into bib
> records (of course) and Purchase Order records.
>
> Mostly my script takes individual subfields in the 949 and re-combines
> them in several ways so that I get the codes I need.  However, I also want
> to take information in the 951 and do some logic on it, like "if the
> physical format is 'Paperback' then assign a vendor ID of 1234."
>
> So, I need to do pattern matching, I think from the docs I'm supposed to
> do it like this: if($phys_format->as_string() =~ /Paperback/ ). I think I
> need the "as_string" in order to do regular expressions, yes?
>
> However, what I get back from the interpreter is "Can't locate object
> method 'as_string' via package Paperback (perhaps you forgot to load
> Paperback)?"
>
> The error is on line 153 of the attached script.  I've also attached the
> MARC record I've been testing.
>
> Can anyone help out a newb?  Thanks so much.
>
> Migell Acosta
> County of Los Angeles Public Library
> [email protected]
> 562-940-8553
>



-- 
Saiful Amin
+91 9343826438

"I think we can find excuses in life or we can find inspirations. I've
always tried to find inspirations." - Andre Agassi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.