Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

How to replace the output (new html page)?

by Gary Yang (Acolyte)
on Jan 18, 2012 at 22:41 UTC ( #948639=perlquestion: print w/replies, xml ) Need Help??
Gary Yang has asked for the wisdom of the Perl Monks concerning the following question:

I do not know if this is a Perl or html question. Please help.
My Perl script runs at Server Site. When the script gets called, it outputs (prints) a progress html page displayed at Client site. When the program ends, it generates a new html page. This new html page should replace that progress page. However, instead of replacing the ProgressPage, the new html page is appended to ProgressPage. I use Perl here doc to print html pages. Below is the sample code.

First, print Progress Page.

Print <<ProgressPage; <html> <head> .. </head> <body> .. </body> </html> ProgressPage

Then, print the new HTML page. I want the new HTML page (NewPage) replaces ProgressPage. But, instead of replacing it, NewPage appends to ProgressPage. Can someone tell me how to replace ProgressPage with NewPage?

print <<NewPage; <html> <head> </head> <body> </body> </html> NewPage

Replies are listed 'Best First'.
Re: How to replace the output (new html page)?
by Anonymous Monk on Jan 19, 2012 at 04:04 UTC
Re: How to replace the output (new html page)?
by Anonymous Monk on Jan 19, 2012 at 11:24 UTC

    You are searching for some kind of server push with HTTP. It can be done -- look at a Bugzilla's after-search "munching bugs" screen.

    I'm not familiar with it, but I suspect it is a case of sending two files with "Content-Disposition: inline" and some sort of MIME splitting to distinguish the two HTML pages. Try to find out more by reading the Bugzilla source.

      As the other Anon hinted at, server push technology (originally introduced by Netscape -- yes, it's that old) appears not to work in MSIE, but the other major browsers seem to handle it fine.

      An alternative solution would be to save your second HTML page (temporarily?) to a publicly-accessible place, and redirect/link there once you are done. Some strategically placed output flushing might work best there (but might also be broken by a change of your web server or CGI serving configuration).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://948639]
Approved by ww
[ambrus]: This is different from MS Word, which was already a good editor in the pre-unicode days (in word for windows versions 2 and 6, which ran on windows 3 but also on windows 95), only it wasn't trying to solve the task of writing maths papers back then.
[Discipulus]: ah ok, sounds reasonable; with no fear: Perl all life long
[ambrus]: Mind you, LaTeX is currently still useful for writing math paper or snippet content without styling in such a way that the
[ambrus]: formatting conventions of a journal or website can be quickly applied to it, and MS Office and LibreOffice has not quite solved this (although it's better for this than it used to be),
[ambrus]: which is sort of a drawback compared to the ages of typewritten manuscripts representing content only to which the typesetter applies formatting, but that process required much more manual labor.
[ambrus]: If you want to typeset a manuscript, you can still do much less work then in the manual typesetting ages and get good formatting.
[ambrus]: All with only cheap modern computers and software.
[ambrus]: Something you can have at home and your corner print shop, without a whole printing press's worth of equipment.

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2017-09-26 11:16 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (293 votes). Check out past polls.