Print

Print


On Mon, 2 Feb 2009, Eric Lease Morgan wrote:

> On 1/30/09 4:39 PM, "Jay Luker" <[log in to unmask]> wrote:
>
>> $r = do { local $/; <C> };
>>
>> Explained here:
>> http://www.perlmonks.org/?node_id=287647
>
>
> As long as I can afford the RAM (a batch of MARC records might be 10's or
> 100's of megabytes in size), this looks like the best solution. Thanks.

Is there a seperator between MARC records?

If so, you can set $/ to that, and you'll get one MARC record at a time.

If the record seperator is an empty line, you'll probably want to read 
'perlvar' in perldocs ... search for 'INPUT_RECORD_SEPARATOR' for the 
difference between setting it to '' vs "\n\n":

 	http://perldoc.perl.org/perlvar.html

-Joe