Home > Archive > PERL Programming > October 2005 > Saving variables over multiple pages
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Saving variables over multiple pages
|
|
| Ed Jay 2005-10-29, 3:56 am |
| I'm writing a Perl script that processes various form data and outputs a
report based on the data. I want to use a single Perl script, but collect
the data on multiple html pages. I do not particularly want to create the
html pages from within the Perl script. How do I do it?
--
Ed Jay (remove M to respond by email)
| |
| Stuart 2005-10-29, 7:55 am |
| Ed Jay wrote:
> I'm writing a Perl script that processes various form data and outputs a
> report based on the data. I want to use a single Perl script, but collect
> the data on multiple html pages. I do not particularly want to create the
> html pages from within the Perl script. How do I do it?
>
You could do it using JavaScript (as long as the user has it enabled!),
but using Perl for the pages would be a far simpler way of doing things.
--
Stuart Brown <stuart@edesign.cc>
http://www.edesign.cc
| |
| Joe Smith 2005-10-30, 7:55 am |
| Ed Jay wrote:
> I'm writing a Perl script that processes various form data and outputs a
> report based on the data. I want to use a single Perl script, but collect
> the data on multiple html pages. I do not particularly want to create the
> html pages from within the Perl script. How do I do it?
What is the source of the form data? Are you getting it from a file
(data previously processed) or straight from the browser (CGI in realtime)?
For the latter, simply use a hidden field to identify which subsection
of your CGI program to use to parse the data. Grab the data from
the browser as each page comes in and write it somewhere. You'll
have to have some sort of mechanism to inform your CGI when the
data collection is complete so that it can create a summary.
This is assuming that you are not trying to parse the HTML output
from another site's CGI program. You'd want WWW::Mechanize for that.
-Joe
| |
| Ed Jay 2005-10-30, 6:58 pm |
| Joe Smith <joe@inwap.com> wrote:
>Ed Jay wrote:
>
>What is the source of the form data? Are you getting it from a file
>(data previously processed) or straight from the browser (CGI in realtime)?
>
>For the latter, simply use a hidden field to identify which subsection
>of your CGI program to use to parse the data. Grab the data from
>the browser as each page comes in and write it somewhere. You'll
>have to have some sort of mechanism to inform your CGI when the
>data collection is complete so that it can create a summary.
>
>This is assuming that you are not trying to parse the HTML output
>from another site's CGI program. You'd want WWW::Mechanize for that.
>
Thanks, Joe.
I ended up doing as you suggested, above. I read in a page from a browser,
save the data, and create the next page from within the Perl script with
the previously stored data as a hidden form field.
--
Ed Jay (remove M to respond by email)
|
|
|
|
|