This makes the assumption that the file fits in RAM. This is usually, but not always, a safe assumption. Things may get complicated if that's not the case. Since we're not talking about line-oriented text files read (and possibly sysread and syswrite) would be good additional reading.
If there are fixed-length records there are ways to deal with that. If there are record terminators consistent throughout the file, there's a way to deal with that, too. See $/ for more information.
In reply to Re^2: how to read binary file and give a binary output?
by mr_mischief
in thread how to read binary file and give a binary output?
by perllearn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |