A common mistake is to print a header and then do a redirect, which slows
the process down because essentially you have a script and a page competing
to generate a header. When using redirect(), do not do this:
#!/usr/bin/perl
use CGI;
my $q = new CGI;
print $q->header(); # don't need this if redirecting!
print $q->redirect('http://www.whatever.com');
Do this instead:
#!/usr/bin/perl
use CGI;
my $q = new CGI;
print $q->redirect('http://www.whatever.com');
Or another option:
#!/usr/bin/perl
my $url = 'http://whatever.com';
print "Location: $url\n\n";
HTH,
Scot R.
inSite
-----Original Message-----
From: Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 14, 2002 7:35 AM
To: [EMAIL PROTECTED]
Subject: redirect()
After complaints that my CGI takes too long, I traced it down to the
redirect() function.
Why does it take so long?
Is there an alternative?
Jonathan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]