View Review Details


Book:   Perl Cookbook
Subject:   Perl Cookbook Review
Date:   2003-02-26 14:19:40
From:   Al Rizo-Patron
Rating:  StarStarStarStarStar

A clarification to my previous comment: I said tctee.pl does not work for binary files. That is true only for Windows, not Unix. To make it work for Windows, it needs to use the binmode() function on the filehandles. Unix ignores binmode(), and then again, it already has 'tee'. Still, tctee example given can be *very* slow in Windows on binary files because any character picked as a record delimiter could occur literally millions of times. Therefore, the I/O is better done with sysread() and syswrite() with a reasonably sized block size, or something like $blksize = (stat $fh)[11] || 131072;

See larger cover
Browse within this book