Re: inserting diacrtics

2005-01-05 Thread Ed Summers
On Tue, Jan 04, 2005 at 02:20:55PM -0500, Jackie Shieh wrote:
> MARC::Field->new('710','2','', a=>'Bibliotheque nationale de france.')
>^

I'm assuming that you want a combining acute on the e, and that you want to 
encode with MARC-8 since UTF-8 in MARC data hasn't hit the mainstream yet...
eventhough I've heard OCLC is converting all their MARC data to UTF-8.

This is kind of a pain, but here's how you could do it. You need to
escape to ExtendedLatin, add the combining acute, escape back to 
BasicLatin, and then put the 'e'. Or in code:

# building blocks for escaping G0 to ExtendedLatin and
# back to BasicLatin, details at: 
# http://www.loc.gov/marc/specifications/speccharmarc8.html
$escapeToExtendedLatin = chr(0x1B).chr(0x28).chr(0x21).chr(0x45);
$escapeToBasicLatin = chr(0x1B).chr(0x28).chr(0x52); 

# acute in the G0 register is chr(0x62) from the table at:
# http://lcweb2.loc.gov/cocoon/codetables/45.html
$acute = $escapeToExtendedLatin.chr(0x62).$escapeToBasicLatin;

# now make the field
$field = MARC::Field->new( '710', '2', '', 
a => 'Biblioth'.$acute.'eque nationale de france.' );

This is long because I wanted to explain what was going on...I imagine
it could be compressed nicely...maybe

Please give this a try on one record and make sure your catalog displays
it properly before doing anything drastic to your data. Like I needed
to mention that :-)

//Ed


Re: inserting diacrtics

2005-01-05 Thread Jackie Shieh
Oh dear! What a convoluted process!  It's incredible!

OK, the e in the Bibliotheque is "grave". So does this mean
that all I need is to change the acute to grave and x62 to x61?
I will test it out and let you know, thanks Ed!

--Jackie

On Wed, 5 Jan 2005, Ed Summers wrote:

> On Tue, Jan 04, 2005 at 02:20:55PM -0500, Jackie Shieh wrote:
> > MARC::Field->new('710','2','', a=>'Bibliotheque nationale de france.')
> >^
>
> I'm assuming that you want a combining acute on the e, and that you want to
> encode with MARC-8 since UTF-8 in MARC data hasn't hit the mainstream yet...
> eventhough I've heard OCLC is converting all their MARC data to UTF-8.
>
> This is kind of a pain, but here's how you could do it. You need to
> escape to ExtendedLatin, add the combining acute, escape back to
> BasicLatin, and then put the 'e'. Or in code:
>
> # building blocks for escaping G0 to ExtendedLatin and
> # back to BasicLatin, details at:
> # http://www.loc.gov/marc/specifications/speccharmarc8.html
> $escapeToExtendedLatin = chr(0x1B).chr(0x28).chr(0x21).chr(0x45);
> $escapeToBasicLatin = chr(0x1B).chr(0x28).chr(0x52);
>
> # acute in the G0 register is chr(0x62) from the table at:
> # http://lcweb2.loc.gov/cocoon/codetables/45.html
> $acute = $escapeToExtendedLatin.chr(0x62).$escapeToBasicLatin;
>
> # now make the field
> $field = MARC::Field->new( '710', '2', '',
> a => 'Biblioth'.$acute.'eque nationale de france.' );
>
> This is long because I wanted to explain what was going on...I imagine
> it could be compressed nicely...maybe
>
> Please give this a try on one record and make sure your catalog displays
> it properly before doing anything drastic to your data. Like I needed
> to mention that :-)
>
> //Ed
>


Re: inserting diacrtics

2005-01-05 Thread Ed Summers
On Wed, Jan 05, 2005 at 01:02:37PM -0500, Jackie Shieh wrote:
> OK, the e in the Bibliotheque is "grave". So does this mean
> that all I need is to change the acute to grave and x62 to x61?
> I will test it out and let you know, thanks Ed!

So much for my highschool French!

0x61 should do the trick. 

//Ed


RE: inserting diacrtics

2005-01-05 Thread Doran, Michael D
> You need to escape to ExtendedLatin, add the combining acute, escape
back to 
> BasicLatin, and then put the 'e'. Or in code:

Extended Latin (as G1) is part of the MARC-8 default character set and
shouldn't require any escape sequences [1].  I think all Jackie needs to
do is add the combining grave character.

-- Michael

# Michael Doran, Systems Librarian
# University of Texas at Arlington
# 817-272-5326 office
# 817-688-1926 cell
# [EMAIL PROTECTED]
# http://rocky.uta.edu/doran/ 

> -Original Message-
> From: Ed Summers [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, January 05, 2005 11:30 AM
> To: perl4lib@perl.org
> Subject: Re: inserting diacrtics
> 
> On Tue, Jan 04, 2005 at 02:20:55PM -0500, Jackie Shieh wrote:
> > MARC::Field->new('710','2','', a=>'Bibliotheque nationale 
> de france.')
> >^
> 
> I'm assuming that you want a combining acute on the e, and that you
want to 
> encode with MARC-8 since UTF-8 in MARC data hasn't hit the mainstream
yet...
> eventhough I've heard OCLC is converting all their MARC data to UTF-8.
> 
> This is kind of a pain, but here's how you could do it. You need to
> escape to ExtendedLatin, add the combining acute, escape back to 
> BasicLatin, and then put the 'e'. Or in code:
> 
> # building blocks for escaping G0 to ExtendedLatin and
> # back to BasicLatin, details at: 
> # http://www.loc.gov/marc/specifications/speccharmarc8.html
> $escapeToExtendedLatin = chr(0x1B).chr(0x28).chr(0x21).chr(0x45);
> $escapeToBasicLatin = chr(0x1B).chr(0x28).chr(0x52); 
> 
> # acute in the G0 register is chr(0x62) from the table at:
> # http://lcweb2.loc.gov/cocoon/codetables/45.html
> $acute = $escapeToExtendedLatin.chr(0x62).$escapeToBasicLatin;
> 
> # now make the field
> $field = MARC::Field->new( '710', '2', '', 
> a => 'Biblioth'.$acute.'eque nationale de france.' );
> 
> This is long because I wanted to explain what was going on...I imagine
> it could be compressed nicely...maybe
> 
> Please give this a try on one record and make sure your 
> catalog displays
> it properly before doing anything drastic to your data. Like I needed
> to mention that :-)
> 
> //Ed
> 


RE: inserting diacrtics

2005-01-05 Thread Doran, Michael D
Oops, that's the second time today I've inadvertantly sent an email
message (some keystroke combination from vi I think).

The reference was:

[1] The exception to this is if you had previously escaped to an
alternate character set (such as Arablic or Greek) and desired to return
to Extended Latin as either GO or G1.

-- Michael

# Michael Doran, Systems Librarian
# University of Texas at Arlington
# 817-272-5326 office
# 817-688-1926 cell
# [EMAIL PROTECTED]
# http://rocky.uta.edu/doran/ 

> -Original Message-
> From: Doran, Michael D 
> Sent: Wednesday, January 05, 2005 1:03 PM
> To: perl4lib@perl.org
> Subject: RE: inserting diacrtics
> 
> > You need to escape to ExtendedLatin, add the combining 
> acute, escape back to 
> > BasicLatin, and then put the 'e'. Or in code:
> 
> Extended Latin (as G1) is part of the MARC-8 default 
> character set and shouldn't require any escape sequences [1]. 
>  I think all Jackie needs to do is add the combining grave character.
> 
> -- Michael
> 
> # Michael Doran, Systems Librarian
> # University of Texas at Arlington
> # 817-272-5326 office
> # 817-688-1926 cell
> # [EMAIL PROTECTED]
> # http://rocky.uta.edu/doran/ 
> 
> > -Original Message-
> > From: Ed Summers [mailto:[EMAIL PROTECTED] 
> > Sent: Wednesday, January 05, 2005 11:30 AM
> > To: perl4lib@perl.org
> > Subject: Re: inserting diacrtics
> > 
> > On Tue, Jan 04, 2005 at 02:20:55PM -0500, Jackie Shieh wrote:
> > > MARC::Field->new('710','2','', a=>'Bibliotheque nationale 
> > de france.')
> > >^
> > 
> > I'm assuming that you want a combining acute on the e, and 
> that you want to 
> > encode with MARC-8 since UTF-8 in MARC data hasn't hit the 
> mainstream yet...
> > eventhough I've heard OCLC is converting all their MARC 
> data to UTF-8.
> > 
> > This is kind of a pain, but here's how you could do it. You need to
> > escape to ExtendedLatin, add the combining acute, escape back to 
> > BasicLatin, and then put the 'e'. Or in code:
> > 
> > # building blocks for escaping G0 to ExtendedLatin and
> > # back to BasicLatin, details at: 
> > # http://www.loc.gov/marc/specifications/speccharmarc8.html
> > $escapeToExtendedLatin = 
> chr(0x1B).chr(0x28).chr(0x21).chr(0x45);
> > $escapeToBasicLatin = chr(0x1B).chr(0x28).chr(0x52); 
> > 
> > # acute in the G0 register is chr(0x62) from the table at:
> > # http://lcweb2.loc.gov/cocoon/codetables/45.html
> > $acute = $escapeToExtendedLatin.chr(0x62).$escapeToBasicLatin;
> > 
> > # now make the field
> > $field = MARC::Field->new( '710', '2', '', 
> > a => 'Biblioth'.$acute.'eque nationale de france.' );
> > 
> > This is long because I wanted to explain what was going 
> on...I imagine
> > it could be compressed nicely...maybe
> > 
> > Please give this a try on one record and make sure your 
> > catalog displays
> > it properly before doing anything drastic to your data. 
> Like I needed
> > to mention that :-)
> > 
> > //Ed
> > 
> 


RE: inserting diacrtics

2005-01-05 Thread Doran, Michael D
One more time (in an attempt to better clarify my own posting --
sorry)...

> I think all Jackie needs to do is add the combining grave character.

The combining grave, in G1, would be hex 'E1', so (theoretically) this
should work:

   $acute = chr(0xE1);
   $field = MARC::Field->new( '710', '2', '', 
a => 'Biblioth'.$acute.'eque nationale de france.' );

-- Michael

# Michael Doran, Systems Librarian
# University of Texas at Arlington
# 817-272-5326 office
# 817-688-1926 cell
# [EMAIL PROTECTED]
# http://rocky.uta.edu/doran/ 

> -Original Message-
> From: Doran, Michael D [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, January 05, 2005 1:04 PM
> To: perl4lib@perl.org
> Subject: RE: inserting diacrtics
> 
> Oops, that's the second time today I've inadvertantly sent an email
> message (some keystroke combination from vi I think).
> 
> The reference was:
> 
> [1] The exception to this is if you had previously escaped to an
> alternate character set (such as Arablic or Greek) and 
> desired to return
> to Extended Latin as either GO or G1.
> 
> -- Michael
> 
> # Michael Doran, Systems Librarian
> # University of Texas at Arlington
> # 817-272-5326 office
> # 817-688-1926 cell
> # [EMAIL PROTECTED]
> # http://rocky.uta.edu/doran/ 
> 
> > -Original Message-
> > From: Doran, Michael D 
> > Sent: Wednesday, January 05, 2005 1:03 PM
> > To: perl4lib@perl.org
> > Subject: RE: inserting diacrtics
> > 
> > > You need to escape to ExtendedLatin, add the combining 
> > acute, escape back to 
> > > BasicLatin, and then put the 'e'. Or in code:
> > 
> > Extended Latin (as G1) is part of the MARC-8 default 
> > character set and shouldn't require any escape sequences [1]. 
> >  I think all Jackie needs to do is add the combining grave 
> character.
> > 
> > -- Michael
> > 
> > # Michael Doran, Systems Librarian
> > # University of Texas at Arlington
> > # 817-272-5326 office
> > # 817-688-1926 cell
> > # [EMAIL PROTECTED]
> > # http://rocky.uta.edu/doran/ 
> > 
> > > -Original Message-
> > > From: Ed Summers [mailto:[EMAIL PROTECTED] 
> > > Sent: Wednesday, January 05, 2005 11:30 AM
> > > To: perl4lib@perl.org
> > > Subject: Re: inserting diacrtics
> > > 
> > > On Tue, Jan 04, 2005 at 02:20:55PM -0500, Jackie Shieh wrote:
> > > > MARC::Field->new('710','2','', a=>'Bibliotheque nationale 
> > > de france.')
> > > >^
> > > 
> > > I'm assuming that you want a combining acute on the e, and 
> > that you want to 
> > > encode with MARC-8 since UTF-8 in MARC data hasn't hit the 
> > mainstream yet...
> > > eventhough I've heard OCLC is converting all their MARC 
> > data to UTF-8.
> > > 
> > > This is kind of a pain, but here's how you could do it. 
> You need to
> > > escape to ExtendedLatin, add the combining acute, escape back to 
> > > BasicLatin, and then put the 'e'. Or in code:
> > > 
> > > # building blocks for escaping G0 to ExtendedLatin and
> > > # back to BasicLatin, details at: 
> > > # http://www.loc.gov/marc/specifications/speccharmarc8.html
> > > $escapeToExtendedLatin = 
> > chr(0x1B).chr(0x28).chr(0x21).chr(0x45);
> > > $escapeToBasicLatin = chr(0x1B).chr(0x28).chr(0x52); 
> > > 
> > > # acute in the G0 register is chr(0x62) from the table at:
> > > # http://lcweb2.loc.gov/cocoon/codetables/45.html
> > > $acute = $escapeToExtendedLatin.chr(0x62).$escapeToBasicLatin;
> > > 
> > > # now make the field
> > > $field = MARC::Field->new( '710', '2', '', 
> > > a => 'Biblioth'.$acute.'eque nationale de france.' );
> > > 
> > > This is long because I wanted to explain what was going 
> > on...I imagine
> > > it could be compressed nicely...maybe
> > > 
> > > Please give this a try on one record and make sure your 
> > > catalog displays
> > > it properly before doing anything drastic to your data. 
> > Like I needed
> > > to mention that :-)
> > > 
> > > //Ed
> > > 
> > 
> 


Re: inserting diacrtics

2005-01-05 Thread Ed Summers
On Wed, Jan 05, 2005 at 01:22:54PM -0600, Doran, Michael D wrote:
>$acute = chr(0xE1);
>$field = MARC::Field->new( '710', '2', '', 
>   a => 'Biblioth'.$acute.'eque nationale de france.' );

Much more compact, thanks Michael.

//Ed


RE: inserting diacrtics

2005-01-05 Thread Jackie Shieh

That DID IT!!!  THANKS SO MUCH!!!

--Jackie

On Wed, 5 Jan 2005, Doran, Michael D wrote:

> One more time (in an attempt to better clarify my own posting --
> sorry)...
>
> > I think all Jackie needs to do is add the combining grave character.
>
> The combining grave, in G1, would be hex 'E1', so (theoretically) this
> should work:
>
>$acute = chr(0xE1);
>$field = MARC::Field->new( '710', '2', '',
>   a => 'Biblioth'.$acute.'eque nationale de france.' );
>
> -- Michael
>
> # Michael Doran, Systems Librarian
> # University of Texas at Arlington
> # 817-272-5326 office
> # 817-688-1926 cell
> # [EMAIL PROTECTED]
> # http://rocky.uta.edu/doran/
>
> > -Original Message-
> > From: Doran, Michael D [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, January 05, 2005 1:04 PM
> > To: perl4lib@perl.org
> > Subject: RE: inserting diacrtics
> >
> > Oops, that's the second time today I've inadvertantly sent an email
> > message (some keystroke combination from vi I think).
> >
> > The reference was:
> >
> > [1] The exception to this is if you had previously escaped to an
> > alternate character set (such as Arablic or Greek) and
> > desired to return
> > to Extended Latin as either GO or G1.
> >
> > -- Michael
> >
> > # Michael Doran, Systems Librarian
> > # University of Texas at Arlington
> > # 817-272-5326 office
> > # 817-688-1926 cell
> > # [EMAIL PROTECTED]
> > # http://rocky.uta.edu/doran/
> >
> > > -Original Message-
> > > From: Doran, Michael D
> > > Sent: Wednesday, January 05, 2005 1:03 PM
> > > To: perl4lib@perl.org
> > > Subject: RE: inserting diacrtics
> > >
> > > > You need to escape to ExtendedLatin, add the combining
> > > acute, escape back to
> > > > BasicLatin, and then put the 'e'. Or in code:
> > >
> > > Extended Latin (as G1) is part of the MARC-8 default
> > > character set and shouldn't require any escape sequences [1].
> > >  I think all Jackie needs to do is add the combining grave
> > character.
> > >
> > > -- Michael
> > >
> > > # Michael Doran, Systems Librarian
> > > # University of Texas at Arlington
> > > # 817-272-5326 office
> > > # 817-688-1926 cell
> > > # [EMAIL PROTECTED]
> > > # http://rocky.uta.edu/doran/
> > >
> > > > -Original Message-
> > > > From: Ed Summers [mailto:[EMAIL PROTECTED]
> > > > Sent: Wednesday, January 05, 2005 11:30 AM
> > > > To: perl4lib@perl.org
> > > > Subject: Re: inserting diacrtics
> > > >
> > > > On Tue, Jan 04, 2005 at 02:20:55PM -0500, Jackie Shieh wrote:
> > > > > MARC::Field->new('710','2','', a=>'Bibliotheque nationale
> > > > de france.')
> > > > >^
> > > >
> > > > I'm assuming that you want a combining acute on the e, and
> > > that you want to
> > > > encode with MARC-8 since UTF-8 in MARC data hasn't hit the
> > > mainstream yet...
> > > > eventhough I've heard OCLC is converting all their MARC
> > > data to UTF-8.
> > > >
> > > > This is kind of a pain, but here's how you could do it.
> > You need to
> > > > escape to ExtendedLatin, add the combining acute, escape back to
> > > > BasicLatin, and then put the 'e'. Or in code:
> > > >
> > > > # building blocks for escaping G0 to ExtendedLatin and
> > > > # back to BasicLatin, details at:
> > > > # http://www.loc.gov/marc/specifications/speccharmarc8.html
> > > > $escapeToExtendedLatin =
> > > chr(0x1B).chr(0x28).chr(0x21).chr(0x45);
> > > > $escapeToBasicLatin = chr(0x1B).chr(0x28).chr(0x52);
> > > >
> > > > # acute in the G0 register is chr(0x62) from the table at:
> > > > # http://lcweb2.loc.gov/cocoon/codetables/45.html
> > > > $acute = $escapeToExtendedLatin.chr(0x62).$escapeToBasicLatin;
> > > >
> > > > # now make the field
> > > > $field = MARC::Field->new( '710', '2', '',
> > > > a => 'Biblioth'.$acute.'eque nationale de france.' );
> > > >
> > > > This is long because I wanted to explain what was going
> > > on...I imagine
> > > > it could be compressed nicely...maybe
> > > >
> > > > Please give this a try on one record and make sure your
> > > > catalog displays
> > > > it properly before doing anything drastic to your data.
> > > Like I needed
> > > > to mention that :-)
> > > >
> > > > //Ed


RE: inserting diacrtics

2005-01-05 Thread Manifold, Alan B.
It's compact, but it might be a little clearer if you call a
grave a grave...

$grave = chr(0xE1);
$field = MARC::Field->new( '710', '2', '', 
a => 'Biblioth'.$grave.'eque nationale de france.' );

Alan Manifold
Systems Implementation Manager
Purdue University Libraries ITD
504 West State Street
West Lafayette, Indiana  47907-2058
(765) 494-2884   FAX:  494-0156
[EMAIL PROTECTED]
http://www.mashiyyat.net/ABM.html 

> -Original Message-
> From: Ed Summers [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, January 05, 2005 2:42 PM
> To: perl4lib@perl.org
> Subject: Re: inserting diacrtics
> 
> On Wed, Jan 05, 2005 at 01:22:54PM -0600, Doran, Michael D wrote:
> >$acute = chr(0xE1);
> >$field = MARC::Field->new( '710', '2', '', 
> > a => 'Biblioth'.$acute.'eque nationale de france.' );
> 
> Much more compact, thanks Michael.
> 
> //Ed
> 


RE: inserting diacrtics

2005-01-05 Thread Doran, Michael D
> it might be a little clearer if you call a grave a grave...

Of course.  Thanks Alan.  This is apparently not my day for clarity. 

-- Michael

> -Original Message-
> From: Manifold, Alan B. [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, January 05, 2005 1:46 PM
> To: perl4lib@perl.org
> Subject: RE: inserting diacrtics
> 
> It's compact, but it might be a little clearer if you call a
> grave a grave...
> 
> $grave = chr(0xE1);
> $field = MARC::Field->new( '710', '2', '', 
>   a => 'Biblioth'.$grave.'eque nationale de france.' );
> 
> Alan Manifold
> Systems Implementation Manager
> Purdue University Libraries ITD
> 504 West State Street
> West Lafayette, Indiana  47907-2058
> (765) 494-2884   FAX:  494-0156
> [EMAIL PROTECTED]
> http://www.mashiyyat.net/ABM.html 
> 
> > -Original Message-
> > From: Ed Summers [mailto:[EMAIL PROTECTED] 
> > Sent: Wednesday, January 05, 2005 2:42 PM
> > To: perl4lib@perl.org
> > Subject: Re: inserting diacrtics
> > 
> > On Wed, Jan 05, 2005 at 01:22:54PM -0600, Doran, Michael D wrote:
> > >$acute = chr(0xE1);
> > >$field = MARC::Field->new( '710', '2', '', 
> > >   a => 'Biblioth'.$acute.'eque nationale de france.' );
> > 
> > Much more compact, thanks Michael.
> > 
> > //Ed
> > 
> 


Re: MARC::Record tests

2005-01-05 Thread Bryan Baldus
Some of the MARC::Record tests have been updated in the past weeks, 
to use File::Spec for file paths. This should allow them to run 
without much user modification on multiple platforms (MacPerl on 
MacOS 9, for example). After some trial and error, the tests seem to 
be working (though more testing is welcome). During the process of 
modifying  81.decode.t, I may have discovered a problem with 
MARC::File::MicroLIF's decode(). Below is some discussion of the 
possible problem:

On Wed, 5 Jan 2005 10:16:01 -0600, Ed Summers wrote (offlist)
On Tue, Jan 04, 2005 at 10:32:58PM -0600, Bryan Baldus wrote (offlist):
OK. The tests for MARC::Record have now been updated, removing
File::Spec->updir(). All pass on my machine (except the ones I
mentioned before--81.decode.t (problem with line endings in MicroLIF
decode() when endings differ from those of the system--since decode()
splits on "\n", and depends on other subs to turn non-native endings
into "\n") and utf8.t (requires 5.8.1)).

Can you send the test report for these failures?

   perl -I lib t/81.decode.t

You will probably have to remove the -T flag at the top of the script.
I modified my local copy of 81.decode.t as follows and created 2 new 
files (sample1unix.lif and sample1mac.lif), though I probably could 
have used the lif files from linendings.t instead.

## slurp up some microlif
my @lifnames = ( 'sample1.lif', 'sample1unix.lif', 'sample1mac.lif' );
foreach my $file (@lifnames) {
my $lifname = File::Spec->catfile( 't', $file );
open(IN, $lifname );
my $str = join( '',  );
close IN;
## attempt to use decode() on it
DECODE_MICROLIF_METHOD: {
my $rec = MARC::File::MicroLIF->decode( $str );
isa_ok( $rec, 'MARC::Record' );
like( $rec->title(), qr/all about whales/i, "retrieved title from file
$lifname" );
}
DECODE_MICROLIF_FUNCTION: {
my $rec = MARC::File::MicroLIF::decode( $str );
isa_ok( $rec, 'MARC::Record' );
like( $rec->title(), qr/all about whales/i, "retrieved title from file
$lifname" );
}
}
#and add 'my' in front of $str below, in the usmarc test.
Results:
C:\Perl\site>perl -I lib t/81.decode.t
1..32
ok 1 - use MARC::Record;
ok 2 - use MARC::File::MicroLIF;
ok 3 - use MARC::File::USMARC;
ok 4 - The object isa MARC::Record
ok 5 - retrieved title from file t\sample1.lif
ok 6 - The object isa MARC::Record
ok 7 - retrieved title from file t\sample1.lif
ok 8 - The object isa MARC::Record
ok 9 - retrieved title from file t\sample1unix.lif
ok 10 - The object isa MARC::Record
ok 11 - retrieved title from file t\sample1unix.lif
ok 12 - The object isa MARC::Record
not ok 13 - retrieved title from file t\sample1mac.lif
# Failed test (t/81.decode.t at line 39)
#   ''
# doesn't match '(?i-xsm:all about whales)'
ok 14 - The object isa MARC::Record
not ok 15 - retrieved title from file t\sample1mac.lif
# Failed test (t/81.decode.t at line 45)
#   ''
# doesn't match '(?i-xsm:all about whales)'
ok 16 - The object isa MARC::Record
ok 17 - retrieved title
ok 18 - The object isa MARC::Record
ok 19 - retrieved title
ok 20 - should be no warnings
ok 21 - gap after field data should not be returned
ok 22 - The object isa MARC::Field
ok 23 - indicators in tag after gap should be OK
ok 24 - subfield a in tag after gap should be OK
ok 25 - subfield b in tag after gap should be OK
ok 26 - subfield c in tag after gap should be OK
ok 27 - The object isa MARC::Record
ok 28 - 001 field correct
ok 29 - 010 field correct
ok 30 - 100 field correct
ok 31 - 245 field correct
ok 32 - 260 field correct
ok 33 - 650 field correct
ok 34 - The object isa MARC::Record
ok 35 - check for appropriate warnings count
ok 36 - 040 warning present
ok 37 - 041 warning present
ok 38 - 245 should not exist
ok 39 - 040 should not exist
ok 40 - 041 should not exist
# Looks like you planned 32 tests but ran 8 extra.
##I didn't bother to change the number in the plan, since this was only a
quick test.
The unmodified version fails (if line endings in sample1.lif differ) 
with errors:
not ok 5 - retrieved title
# Failed test (:t:81.decode.t at line 37)
#   ''
# doesn't match '(?i-xsm:all about whales)'
ok 6 - The object isa MARC::Record
not ok 7 - retrieved title
# Failed test (:t:81.decode.t at line 43)
#   ''
# doesn't match '(?i-xsm:all about whales)'


In other tests, I went for a complicated solution
(Bryan wrote:
50.batch.t now has:
MicroLIF: {
my $filepath = File::Spec->catdir( 't' );
opendir(TESTDIR, $filepath) || die "can't opendir $filepath: $!";
my @files = map {$filepath.$_} (grep { /sample.*\.lif/ && -f
$filepath.$_ } readdir(TESTDIR));
closedir TESTDIR;
#...
)
(Ed responded:
I updated and found t/50.batch.t to fail. I've committed some changes
which fix the problem.
And, of course, specifying the 3 filenames directly, instead of going
through a convoluted procedure looking for them,