DOS uses 1AH (^Z) to indicate eof for a text file -- which means that if the value exists somewhere in your file, you can't use text file semantics to read it. You'll get the same sorts of problems if there are any null bytes in the file.
What I usually do in this situation is:
open "< FH";
binmode FH;
Then of course you can't use the usual file operators to read your data (but you shouldn't be doing that with a binary file anyway, even on *nix -- hopefully someone with more *nix experience can point out the pitfalls there). You would need to use the
read function to get chunks of data from the file and then parse out the resultant buffer.
Something like:
while (read(FH, $buf, 512)) {
do something;
}
Oh ... and thanks for finding a question I could answer so soon ... My apologies if this first attempt is not as helpful as it might be :)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.