On Wed, May 4, 2011 at 9:23 AM, Agnello George <agnello.dso...@gmail.com> wrote: > In my script i am using template toolkit. I am trying to set the > cookie in my browser but all that it does is it prints the following > output on my broswer : > > Set-Cookie: CGISESSID=f032fc8982a1ae022c4f51baa3bc4143; path=/ Date: > Wed, 04 May 2011 13:07:40 GMT Content-Type: text/html; > charset=ISO-8859-1 > > here is my script , how do is set cookie *snip* > print "Content-type: text/html\n\n";
I'm not HTTP expert, but I do know that headers are supposed to end with two new lines (technically, I think they're supposed to be CRLFs). So effectively the HTTP response you're sending is: <<<< Content-type: text/html [Output from $cgi->header(...)...] [Whatever else you happen to output...] >>>> The user agent (e.g., browser) would only recognize the first Content-type line as a header. The rest would be considered the content, which the browser would do its best to interpret as HTML. > my $tt = Template->new( INCLUDE_PATH => "/var/www/html/template" ) || > die "template process failed:$!"; You probably mean ``or`` instead of ``||``. The result may be the same, but technically the precedence is different so if you were calling a subroutine that didn't terminate the program (like die does) then the results might not be as expected. -- Brandon McCaig <http://www.bamccaig.com/> <bamcc...@gmail.com> V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl. Castopulence Software <http://www.castopulence.org/> <bamcc...@castopulence.org> -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/