PDL's TriD graphics now (as of 2.066) uses OpenGL::GLUT which implements glutCloseFunc (although I plan to integrate that back into main OpenGL). The TriD support has received a fair bit of updating this year (2022), and I also intend to bring back the Tk support to enable better viewing controls. See https://github.com/PDLPorters/pdl/issues/328 for the issue tracking this.