[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Large files in macperl



I have a simple perl program - when I run it on Unix against a 78Mbyte text
file - it works fine.  On 5.1.4R4, when I run it on my Powermac - it does
the "while(<IN>) and seems to scan the entire file - and I get an "Out of
memory!" error.  If I run it against a truncated version of the file(1000
lines) it runs fine.  I've tried boosting MacPerls memory to obscene sizes
and I get the same error.  What did I miss reading?
tnx
mgg



#!/usr/bin/perl

$RS = "\012";

open(OUT,"> ts") || die "Can't create ts: $!\n";
open(IN, "tac") || die "Can't open tac $!\n";

while (<IN>) {

   chop;	# strip record separator

   $linecount++;
   "do some processing
   print sometimes"

}
close(OUT);
close(IN);
MacPerl::SetFileInfo("text", "TEXT","ts");

exit(0);



--
That's the wonderful thing  |University of Ill, Computing & Comm Services Ofc
about crayons; they can take|Michael G. Gardner, Associate Director Comm Eng,
you more places than a      |1122 DCL, 1304 W Springfield, Urbana, Il 61801
starship. Guinan/Rascals/TNG|(217)244-0914 FAX(217)244-7089 EMAIL mgg@uiuc.edu



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch