I am a newbie here... (I forgot to I give a title to my node) searched the Perl Monks DB for some enlightenment. I realized that I am not the only one trying to print that "waiting page" while the server is busy doing DB updates. I have some hope that a gentle soul will help me out.
So here is what i've got so far....
First my web server is IIS on Win2K. I am using ActivePerl v5.6.1 (and I wish I wasn't).
I know that the waiting.pl script is being executed (ExitCode is fine). The problem is that it nevers get redirected to waiting.htm.
Maybe I do everything wrong, and if so, you can laugh your guts out... but pretty please explain me why it doesn't work.
#!/usr/bin/perl
##################################
#
# main.pl
#
#################################
use strict;
use CGI::Carp 'fatalsToBrowser';
######### Here we go: We read the forms and so .....
use Win32;
use Win32::Process;
my $ProcessObj;
my stuffTerminated = false;
Win32::Process::Create($ProcessObj,
"c:/perl/bin/perl.exe",
"perl c:/myPerlScriptsDir/waiting.pl",
0,
NORMAL_PRIORITY_CLASS,
".") || die "Create";
######### do stuff while user waiting
sleep(10);
######### when we are done, we signal waiting.pl
open S, ">c:/MyPath/signal.xxx";
print S "stuffTerminated";
close S;
print "Content-type: text/html\n\n";
print "Thank you for waiting... blah-blah-blah";
exit;
#!/usr/bin/perl
##################################
#
# waiting.pl
#
#################################
use strict;
use CGI::Carp 'fatalsToBrowser';
if ( ! open(S, "c:/MyPath/signal.xxx") )
{
#redirect to waiting
my $redirect = "http://myserver/mywebsite/waiting.htm";
print "HTTP/1.0 303 See Other\r\n" if $ENV{PERLXS} eq "PerlIS"; #
+ for perlIS.dll";
print "Location: $redirect\n\n";
}
exit;
#################################
#
#NOTE: waiting.htm has a refresher to waiting.pl
################################
Maybe there are some syntax errors in there... But the idea remains the same.
Now, I am going to walk the dog - Ikare
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.