@gylaz to remove the trailing newline that the heredoc appends I had to do a sub by hand anyway.  Have a trick to clean that up?