At 3:31 pm -0500 22/1/01, Paul Schinder wrote:
| >$tmp = $ENV{TMPDIR};
| >mkdir $tmp, 0;
| >$fout = $temp."temp.out";
| >open FOUT, ">$fout";
| >$fin = 'BU2:Gutenberg Folder:gutenberg_html.tar';
| >open FIN, $fin;
| >while (<FIN>) {
| >/akespear/ and print FOUT;
| > }
| >
| >What am I doing wrong? I wish. The in file is a Unix tar file.
|
| The definition of "line" is determined by whatever is in $/, which is
| usually "\015" on a Mac.
Yes, of course! I solved the problem by simply writing $/ = "\012"; which I didn't
realise would work.
| tar files aren't really designed to be read this way. You'll be much
| happier extracting the individual files in the archive and reading
| them directly one by one.
Not in this case! The archive, only 800K as a gz file, generates about 10000 files.
If I keep it as an archive, I can search them all in one go and in this instance the
result is adequate for my purposes.
Thanks for solving the problem.
JD