The logic is simple: user fills in the form, presses submit and data from form is sent with POST method to a cgi script (let's call it mail.pl), which extracts them and uses somehow; it doesn't really matter how exactly.
What I need is to show a box with "Your message has been sent. Press a button or wait 5 seconds to return.". And after 5 seconds redirect to index.html. But I'm afraid I don't know how to do it. I can print html code with print operator, but how do I make it redirect back to index, when all headers has already been sent at the beginning of the script?
Is it ever possible to do it with perl and cgi, or I have to use javascript or something else?