Thanks Alex for the answer to my previous post. And now the by now customary follow-up questions...
1) Can you run an NPH script as a required library? i.e. Say I only needed to use NPH if something was selected in the form, can I use:
if ($option == 1) {
require "nph-encrypt.pl";
&encrypt;
}
I'm doubtful...
2) I have an NPH script working, but what I would ultimately like to do is push the "Processing..." message to the screen, and then when processing is done, send them off to a results page, using some of the data from the process. Again, because this is an encryption routine, I don't want to use GET, so META refresh is out of the question. I perused the Perl docs and came across PUSH, but can I intergrate that with CGI? Here's the subroutine:
use CGI;
CGI->nph(1);
$|++;
print CGI->header();
print "Encrypting...<br><br>";
&encrypt;
print "Encryption complete.<br><br>";
print "Sending mail...<br><br>";
&sendmail;
print "Mail sent.<br><br>";
print "All done. Test successful.";
}
So after the last print statement I would like to clear the screen and push a new page to the browser. Any ideas?
And 3) As an aside, I'm not sure if I have the PUSH module, so what's the story with installing Perl modules? Do you have to be running as root to install them? I'm not brilliant with modules and up until now I've avoided them (still quite happy with my modified version of cgi-lib.pl!). I realise that as I get more experienced they'll become indispensible, but for now I'd like to work away as I am. That said, the stuff I want to do requires modules more and more, so the time has come...
Thanks,
adam
1) Can you run an NPH script as a required library? i.e. Say I only needed to use NPH if something was selected in the form, can I use:
if ($option == 1) {
require "nph-encrypt.pl";
&encrypt;
}
I'm doubtful...
2) I have an NPH script working, but what I would ultimately like to do is push the "Processing..." message to the screen, and then when processing is done, send them off to a results page, using some of the data from the process. Again, because this is an encryption routine, I don't want to use GET, so META refresh is out of the question. I perused the Perl docs and came across PUSH, but can I intergrate that with CGI? Here's the subroutine:
Code:
sub process { use CGI;
CGI->nph(1);
$|++;
print CGI->header();
print "Encrypting...<br><br>";
&encrypt;
print "Encryption complete.<br><br>";
print "Sending mail...<br><br>";
&sendmail;
print "Mail sent.<br><br>";
print "All done. Test successful.";
}
So after the last print statement I would like to clear the screen and push a new page to the browser. Any ideas?
And 3) As an aside, I'm not sure if I have the PUSH module, so what's the story with installing Perl modules? Do you have to be running as root to install them? I'm not brilliant with modules and up until now I've avoided them (still quite happy with my modified version of cgi-lib.pl!). I realise that as I get more experienced they'll become indispensible, but for now I'd like to work away as I am. That said, the stuff I want to do requires modules more and more, so the time has come...
Thanks,
adam

