in reply to deleting a file after loading

You still didn't post the source, or explain what you mean by "load it to directly to the page". It sounds like you are dumping the image directly into the html. The correct way to handle this is to output a HTML with has an IMG SRC="http://server.com/cgi-bin/picture-server.pl?picture=1" in it. picture-server.pl then loads the correct image and spits it out.

This is (presumeably) how the rotating perlmonks banner works - check the page, the html is layer src="http://206.170.14.74/~adfu/servfu.pl?l,perlmonks,5244" width=470 height=75

So your IMG SRC tag might look like: IMG SRC="http://server.com/cgi-bin/do-image.pl?image-params=blah"
then do-image.pl would be something like:

my $params=$query->params('image-params');
#Calculate image using params
print $query->header('image/gif');
#Now dump the image

The HTML will have to be constructed by another page that sets up the params correctly.

You may also screw with Apache to do what you want, but I'd rather club myself with the keyboard:

You can use the following apache config directives to acheive what you want
Action (provided by mod_action)
AddHandler/SetHandler (provided by mod_mime)
There appears to be a "PerlHandler" directive which allows you to stack handlers on a file. However it might be difficult to use, given the number of posts to bulletin boards about it.

I nearly forgot the most obvious: whack a big button on your output page that says "Click here when finished" and have it point to a script which deletes your file.

Update: OK, I just read your post above. Read the manual, in this case, Ovid's excellent CGI tutorial

____________________
Jeremy
I didn't believe in evil until I dated it.