develooper Front page | perl.perl4lib | Postings from June 2006

Supressing Errors in MARC::Record

Thread Next
From:
Aaron Huber
Date:
June 7, 2006 06:38
Subject:
Supressing Errors in MARC::Record
Message ID:
s4869e70.007@bclgw.browardlibrary.org
I have a script that fetches MARC records from my library's holdings via Z39.50.  Every once in a while a record doesn't have a MARC Record attached to it and I get the following error:

Can't call method "rawdata" on an undefined value at zrss.pl line 47, <STDIN> line 1.

Here's what I have on and around line 47:

        #create new record object
        my $rec = $rs->record($i);  
        
        #read in raw MARC to record
        my $mrec = MARC::Record->new_from_usmarc($rec->rawdata());

I would just like to skip those items without records or suppress this error and just go on to the next record, is this possible? 

Thanks.




Aaron S. Huber
Librarian I - Audiovisual/Popular Library
Northwest Regional Library
3151 University Drive
Coral Springs, FL 33065.
954-341-3965 ext 233
Broward County Library Division
A Service of the Broward County Board of Commissioners
ahuber@browardlibrary.org

>>> <perl4lib-digest-help@perl.org> 06/07/06 8:42 AM >>>

perl4lib Digest 7 Jun 2006 12:42:05 -0000 Issue 242

Topics (messages 2372 through 2372):

Module updates and HTML parsing question
	2372 by: Bryan Baldus

Administrivia:

To subscribe to the digest, e-mail:
	<perl4lib-digest-subscribe@perl.org>

To unsubscribe from the digest, e-mail:
	<perl4lib-digest-unsubscribe@perl.org>

To post to the list, e-mail:
	<perl4lib@perl.org>


----------------------------------------------------------------------


**********************************************************************
Please note: Except for state and federal exemptions, Florida has a very broad public records law. Most written communications to or from County employees regarding County business are public records and available to the public and media upon request. Your e-mail communications may be subject to public disclosure. 

This email and any files transmitted with it are intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender.

This footnote also confirms that this email message has been swept for the presence of computer viruses.
**********************************************************************


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About