Hi Yimeng, 

I'm not sure this is really the best approach or an actual solution, but I put a copy of that version of the file at  https://cars.uchicago.edu/gsecars/data/Larch/Demeter/Template.pm if that helps you or anyone else get Demeter working on MacOSX.

Cheers,