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

Re: [MacPerl] Large files in macperl



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 2:10 PM -0600 2/2/98, Michael G. Gardner wrote:

} 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?

I see you define something called $RS without also saying "use English;".
You're reading in a Unix text file, perhaps?  If so, no wonder it reads the
entire file, since it never finds the default input record separator, \015,
that it needs to tell it a line has ended.

Set $/ = "\012" and see what happens.  Or put a "use English;" at the
beginning of the script.

} 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



- -----
Paul J. Schinder
schinder@pobox.com


-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBNNZh2lZaVc52j0XhEQLqvACgigsReAxy0/JjMgcBnYajaghmbPQAoOKH
2EvBXDg4YaUzouFkLd4BoUON
=G4aj
-----END PGP SIGNATURE-----


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