Mystery solved.  It was indeed bad leaders.
This fixes it:          substr($line,20,8)=~s/45.{3,5}1/4500001/;

Bits 22 and 23 of the leader were "corrupt."  (Anne Highsmith, our SysAdmin,
enlightened me.  They are used by some record vendors for record source
info.)

In case you run into mysterious crashes of MARC:Record while looking at a
text file of MARC records including UTF-8 characters that have passed
through a DOS editor, which I think is how they got messed up.

Mike

On Mon, May 23, 2011 at 5:28 AM, Paul Hoffman <nkui...@nkuitse.com> wrote:

> On Sat, May 21, 2011 at 04:10:49PM -0500, Mike Barrett wrote:
> > When I run the code below, it works fine for a couple thousand MARC
> records,
> > then starts this:
> > str outside of string at C:/Perl64/lib/bytes_heavy.pl line 11.
> >  of uninitialized value in integer eq (==) at
> > C:/Perl64/site/lib/MARC/File/USMARC.pm line 175.
> >  of uninitialized value $tagdata in substr at
> > C:/Perl64/site/lib/MARC/File/USMARC.pm line 178.
> > str outside of string at C:/Perl64/lib/bytes_heavy.pl line 11.
>
> Are those the exact error messages?
>
> > It does that a few dozen times, then finally dies with:
> > str outside of string at C:/Perl64/lib/bytes_heavy.pl line 11.
> >  of uninitialized value in integer eq (==) at
> > C:/Perl64/site/lib/MARC/File/USMARC.pm line 175.
> >  of uninitialized value $tagdata in substr at
> > C:/Perl64/site/lib/MARC/File/USMARC.pm line 178.
> >  of uninitialized value $tagdata in split at
> > C:/Perl64/site/lib/MARC/File/USMARC.pm line 195.
> >  of uninitialized value $indicators in concatenation (.) or string at
> > C:/Perl64/site/lib/MARC/File/USMARC.pm line 200.
> > 't call method "as_string" on an undefined value at getsomefields.plline
> > 25.
>
> Sorry, I can't help with the Perl code, but it sounds to me like a bad
> record.
>
> > Here's the record it appears to have choked on while pulling the 245:
>
> Could you please repost the record as an attachment?
>
> Paul.
>
> --
> Paul Hoffman <nkui...@nkuitse.com>
>

Reply via email to