Sorry Mike, that sounds a bit like you are pulling my nose. I can make it one-line write:
`(buildpath/'dmd.conf').write "[Environment]\nDFLAGS=-I#{prefix}/import -L-L#{lib}"`
But if you feel so strongly about inreplace, you know things you can do.