open SRC, "$source"; open IDX, ">$source.offset"; binmode IDX; while() { print IDX pack 'N', tell SRC; }