I would second Aristotle's suggestion of using PDL, It has a submodule, TriD, I think it is called, that will do 3D scatterplots. This is an all perl solution.
Yes, PDL::Graphics::TriD is a powerful all-PERL solution. A cursory look through the documentation did not reveal any obvious way to use it inside a CGI script, but I'm still studying the problem. If I can find a way to get it to put out GIF or another format that PERL knows how to show in a browser, I'll be set.
To zoom out (ha!) from the problem a bit: web-usable 3D visualisation is probably best done with an idiomatic 3D technology; back in 2004, VRML, now X3D or similar. There are easy ways to visualise STL in a web context, and PDL can output STL today. PDL is intended to do X3D Real Soon Now™; see IndexedFaceSet to 3D lines in two lines of PDL.