[Net-z3950] Different formatting of records - why?

Mike Taylor mike at miketaylor.org.uk
Tue May 24 14:20:41 CEST 2005

> Date: Tue, 24 May 2005 15:02:03 +0200
> From: Dana Sharvit - M <dana.sharvit at exlibris.co.il>
> I have two version of Net::Z3950, the format of the records that is
> returned for the different type of versions is different: for 0.39
> version I get $ as a delimiter between subfields and in the 0.44
> version I get _ as a delimiter and line breaks between subfields .
> Is the difference in the format has to do with the version?

Yes.  See the "Changes" fil included in the distribution:

0.46  Mon Nov 22 23:42:40 2004
	- Use the MARC::Record module for rendering MARC records
	  instead of the older, unsupported and possibly buggy

	  WARNING: This change is backwards incompatible, but that
	  incompatibility will only affect you if you're relying on
	  the precise formatting of $rec->render() on MARC records.

> Is there a way to get it in the same format?

Yes.  Don't use $rec->render() to generate the human-readable version
of the record; fetch the raw data instead -- $rec->rawdata() -- and
feed it to the old-style MARC module yourself.  You'll need code
something like this:

	use MARC;
	my $inc = MARC::Rec->new();
	my($formatted, $status) = $inc->nextrec($rec->rawdata());
	return $formatted->output({ format => 'ascii' });

This has been a public service announcement.

 _/|_	 ___________________________________________________________________
/o ) \/  Mike Taylor  <mike at miketaylor.org.uk>  http://www.miketaylor.org.uk
)_v__/\  "Here comes Hurst, he's got ...  There are some people on the
	 pitch, they think it's all over ...  It is now!" -- Kenneth
	 Wolstenholme, 1966 of course.

Listen to free demos of soundtrack music for film, TV and radio

More information about the Net-z3950 mailing list