Could you clarify please? Your code implies that the data is line feed terminated. $/ = "\n"; Is this correct? Is the remainder of the file terminated with a line feed? If your records are line-feed terminated the a fixed length read needs to account for the terminator. One byte for unix, two for Windows. Are you saying that the last line is a partial line? 2600 mod ( 56 + 1) equals 4 ? Either way your last call to read() did retrieve the data and it should be in $out it's just that read returned eof. Just call unpack again after the loop terminates. You need to declare $out outside of the loop so that it is readable outside of the loop. Also be aware that if you call pack on an undersized string some values will not be returned.
s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s
|-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,,
$|=1,select$,,$,,$,,1e-1;print;redo}