in reply to Problem reading data file
Your code is not very clear about what you want to do. How about stepping back and decoding the whole record with something like:
modulo some adjustments for line endings and the like. It is usually less troublesome to code in chunks like that than to fuss with index twiddling. I've set this up to read the whole file, but the unpack idea will work as well for handling one line at a time.my @records; { # local $/ = \1322; # may be desirable open IN, '<', '/path/to/file.data' or die $!; @records = map { [ unpack "C1024 C44 C26 C44 C26 C44 C26 C44 C26", $_ ] } <IN>; close IN or die $!; }
Perhaps you do, you seem to have snipped parts of the code setting up your variables, but use strict; and use warnings; will help you find some kinds of weakness in your code.
After Compline,
Zaxo
|
|---|