in reply to Table Pictures

You forgot binmode. Perhaps you didn't use a Windows system, even though you're using Windows BMP files?

Some other ideas: you can essentially use an offset with unpack by using a "skip a byte" code with a multiplier. That would be far easier than using ord arithmetic and substr. How about (untested)

my ($col, $row)= unpack ("x18 v2", $temp);
—John