I just tested with a few debug statements:
print "$num image data blocks\n";
print "pos: $pos, size: $size, pad: $pad, ";
and tested on one of the Panasonic RW2 files I have.
I got the same offset as reported other programs, and the size reported here appears to be plausible, 22986752 for a 23603906 file.
I think this might work.