Sep 29, 2006 #1 davef101 MIS Joined Mar 3, 2006 Messages 34 Location GB Whats wrong with this, it causes a 'Internal Server Error' .. use CGI qwall); use CGI::Cookie; my $cookie = $q->cookie ( -name => 'COOKIENAME', -value => '', -path => '/', -expires => '-1d' ); print $q->header(-cookie => $cookie); <html> .... </html>
Whats wrong with this, it causes a 'Internal Server Error' .. use CGI qwall); use CGI::Cookie; my $cookie = $q->cookie ( -name => 'COOKIENAME', -value => '', -path => '/', -expires => '-1d' ); print $q->header(-cookie => $cookie); <html> .... </html>
Sep 29, 2006 #2 Kirsle Programmer Joined Jan 21, 2006 Messages 1,179 Location US Maybe it's because your HTML code is just out there in the open? Try this: Code: use CGI qw(:all); use CGI::Cookie; my $cookie = $q->cookie ( -name => 'COOKIENAME', -value => '', -path => '/', -expires => '-1d' ); print $q->header(-cookie => $cookie); print qq~<html> .... </html>~; (just make sure your html code doesn't have a ~ symbol in it and it will work just fine. If it does have a ~, escape it with \~) Upvote 0 Downvote
Maybe it's because your HTML code is just out there in the open? Try this: Code: use CGI qw(:all); use CGI::Cookie; my $cookie = $q->cookie ( -name => 'COOKIENAME', -value => '', -path => '/', -expires => '-1d' ); print $q->header(-cookie => $cookie); print qq~<html> .... </html>~; (just make sure your html code doesn't have a ~ symbol in it and it will work just fine. If it does have a ~, escape it with \~)
Sep 29, 2006 #3 KevinADC Technical User Joined Jan 21, 2005 Messages 5,070 Location US check the server error log, probably has something like: Can't call method "cookie" on an undefined value at yourscript.pl line xx. Code: use CGI; [b]my $q = CGI->new;[/b] my $cookie = $q->cookie ( -name => 'COOKIENAME', -value => '', -path => '/', -expires => '-1d' ); print $q->header(-cookie => $cookie); print qq~<html> .... </html>~; Upvote 0 Downvote
check the server error log, probably has something like: Can't call method "cookie" on an undefined value at yourscript.pl line xx. Code: use CGI; [b]my $q = CGI->new;[/b] my $cookie = $q->cookie ( -name => 'COOKIENAME', -value => '', -path => '/', -expires => '-1d' ); print $q->header(-cookie => $cookie); print qq~<html> .... </html>~;
Sep 29, 2006 #4 PaulTEG Technical User Joined Sep 26, 2002 Messages 4,469 Location IE Here's a thing internal server error and there's no real FAQ on how to resolve it, we just keep answering the same thing over and over ... anyone up for it? ;-) point: If you write an FAQ, link to a thread, that others may contribute, ... wish I did that just a thought ... Paul ------------------------------------ Spend an hour a week on CPAN, helps cure all known programming ailments ;-) Upvote 0 Downvote
Here's a thing internal server error and there's no real FAQ on how to resolve it, we just keep answering the same thing over and over ... anyone up for it? ;-) point: If you write an FAQ, link to a thread, that others may contribute, ... wish I did that just a thought ... Paul ------------------------------------ Spend an hour a week on CPAN, helps cure all known programming ailments ;-)