I think we have a winner. 
Hi Rich. Good to hear. I'll be using this version myself

Out of curiosity, how long does this latest version take on your hardware?
Here you go:
$ time treegen vlc-dev.tcz >/tmp/vlc-dev.tcz.tree
real 0m 0.67s
user 0m 0.40s
sys 0m 0.22sSo 1.86 sec before, 0.67 sec now. Your optimizations help a whole lot: The new version gets the job done in less than half the time, even with the call to gsub.
Thank you for your collaboration with this. Always a pleasure.