On Fri, Jan 30, 2009 at 4:12 PM, Eric Lease Morgan <[log in to unmask]> wrote:
> Is there any way I can make my Perl wrapper for yaz-marcdump, below, more
> efficient?
Dump as you go rather than read up the whole thing into memory. Actually,
why do you need perl at all? This is just a regular yaz-marcdump call.
Pipe it into your indexer.
Otherwise, skip the subroutine and just do:
> open (C, "$y $file |") or die "Can't open converter: $!\n";
> print, while (<C>);
> close C;
>
Wouldn't your code have been getting only the last line $r returned?
Perhaps you intended to append to $r each pass through the loop.
--Joe
|