Next | Lightweight Databases | 33 |
I could probably talk all day about the various problems that come up
So instead, we'll have one slide
This always works, no matter what:
my $position = tell FH;
# read and write FH here ...
seek FH, $position, SEEK_SET;
This always works, no matter what:
seek FH, 0, SEEK_SET;
Bytes and characters are the same on Unix systems when files have 8-bit encodings
(Like ordinary text files, or files with ISO-8859 characters)
Ditto for DOS/Windows systems if the filehandle is in binary mode:
binmode(FH);
Next | Copyright © 2003 M. J. Dominus |