I'm still not quite clear on the sequence of events, but I'm going to put what I think is happening and then what I think you should do (this is what we call "error propagation" in my line of work...)
- Point browser to FOO.html
- submit form to BAR.pl
- BAR.pl modifies FOO.html
- Browser is redirected to FOO.html
Is that right? If so, then the first suggestion is more or less right (for the "less", see use CGI or die;). The key is that those statements must be the first and only things printed to STDOUT by BAR.pl--if you print out a regular header first (using the header() method from CGI.pm), then it will just become part of the document body.
Since I've made a fair passel of assumptions so far, I'll go ahead and assume you're using CGI.pm, as well. In which case, replace your call to print header("text/html"); with one to print redirect($new_url); and all will be well.
I hope some of this is helpful--if my assumptions are totally off, we can go another round. :-)
If God had meant us to fly, he would *never* have give us the railroads.
--Michael Flanders
|