format for the turn statment: TURN # lng lat ptNdx #pts turnDeg outHdg inHdg km text-instructions

the 1 in the turn line corresponds with the number of points in the shape data corresponding with the turn.. I'm not sure why the second method works. If you get a script to work, post it (noting your change in the comments at the top). Without a good way of testing it, I can't be sure I made the change correctly.

I think the best solution, is to have the perl script do everything, and use python to do coordinate conversion.