Hi, I'm ITUB, the author of Chemistry::Mol (I don't have an account here). These modules are still far from finished, so they still lack methods for joining and splitting molecules. Therefore the only general method of joining molecules is what simonm suggested.
However, the code you give suggests that the question you were really asking was actually answered by Mr. Muskrat.
Anyway, if you want more information on this project (still under construction, as I said), go to http://www.perlmol.org. You can subscribe to the mailing list if you want to hear about updates.