I have spent much time Googling today trying to find out how to write data from a Perl Script to an existing HTML window. Well, I gave up on Google. There must be a way to do it.
If I output HTML from Perl it usually spawns a new window.
My question: Lets say that I use Javascript to open an HTML window (so I have the window handle) can I direct my output from a Perl program to that open window? It would be nice if I could direct to output to a specific region of the page by using an element's ID, but it would not be a problem if I needed to re-write/replace the HTML in the window.
Are you calling your script from the new page? If so, and you don't have any perl code that is creating a new page, then the script output should appear in the open HTML page.
There's always a better way. The fun is trying to find it!
Yes. The script would be called from the open window. If you use the print <<HTML; or just print commands from perl, it creates a new window. How do I direct it to write to an already open window/page? More specifically, how do I get write to a specific area of a page?
On this open page, it will ask a series of questions. I would like the answers/output to be written to the open page. I did not really want to re-create the page each time.
If you want to dynamically write to the open page without re-loading then you are talking javascript.
You could experiment with FRAMES or IFRAMES so that only a section of the open window is re-loaded? This adds a little complexity to the HTML code however it may be what you need?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.