Copy molecule with center of mass at random coordinates

Hi all,

I would like to copy meso-molecule from xsd file to crystal structure at random coordinates.
I know how to generate random x,y,z point, but stuck in how to copy given molecule where the center of the mass will match random point.

Do you know perhaps how to do that in perl?

Best,
Bojan