> -----Original Message----- > From: KeN ClarK [mailto:[EMAIL PROTECTED]] > Sent: Sunday, December 30, 2001 9:25 PM > To: [EMAIL PROTECTED] > Subject: redirect to URL[linux,apache] > > > 1. I'm VERY new. > 2. I have the Perl Cookbook & Learning Perl. > 3. I can't figure this out, and searches on the web have only > shown me > MORE complicated methods w/multiple redirect options. > > WHERE I AM AT: > > apache shows errors below: > > [Sun Dec 30 20:42:40 2001] [error] (8)Exec format error: exec of > /var/www/cgi-bin/quantdirect.pl failed > [Sun Dec 30 20:42:40 2001] [error] [client 66.188.78.192] > Premature end of > script headers: /var/www/cgi-bin/quantdirect.pl > > script is HERE: > > #/usr/local/bin/perl -w
The first two chars must be #! That's what's causing the error message. > use CGI qw(:cgi); You bring in the CGI module, but never use it. > use strict; > > $myurl = "http://www.quantifier.org/phpquant/"; Since you use strict, you need to say "my $myurl" > > print "Location: $myurl\n\n"; Techincally, header lines should be followed by "\r\n", not just "\n" > exit; exit() is superfluous here. Here's how I would rewrite this: #!/usr/local/bin/perl -w use strict; use CGI qw(:cgi); print redirect("http://www.quantifier.org/phpquant/"); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]