I'm not entirely sure what you are doing.
I would go to various "live webcam" sites and look at their source code.
Most of them do it with the html "refresh" command.
<html><head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<meta HTTP-EQUIV="Refresh" CONTENT="100">
That refreshes the page every 100 seconds. The problem is I'm not
sure every browser supports it. Works good on Mozilla.
Then just have the perl script change your images as needed, and
the browsers will get them every 100 seconds.
Maybe you could combine the "refresh" with a java slideshow script.
Like the one here Java Slideshow