in reply to Re^2: substr in nested foreach loop
in thread substr in nested foreach loop

Well... I don't know what the problem may be, but maybe you should add a
print length($hline),"\n";
before the substr that's dying, just to be sure, maybe even print the line.

But the main reason I write is to suggest using one unpack instead of three substrs... syntax would be (approximately, not tested)

($xh,$yh,$zh) = unpack("x31A8x1A8A8",$hline);
Pretty sure that would be more efficient.

                - Ant
                - Some of my best work - (1 2 3)