in reply to Binary Data File
There are various ways of tackling this. You should take a look at the perlvar description of $/ (search for $INPUT_RECORD_SEPARATOR). As well as being able to be set to a string such as "\n" etc. it can also be set to a reference to a number as in local $/=\20; This will then cause the diamond operator references to a filehandle <FILEHANDLE> to read the file in chunks of n chars.
You can also process fixed length records from a file using pack and unpack, or indeed using read as your snippet shows.
If you would post a description of the record format it would be possible for us to help you narrow down the best choice and provide a little sample code that would help you further.
|
|---|