in reply to Re^5: Cookie and Session
in thread Cookie and Session

Sir, Your codes give this output:
Content-Type: text/html; charset=UTF-8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-U +S"> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <b>861183026.613647 Fri Nov 4 05:18:53 2011</b><table border="1" wi +dth="%100"><tr><td><ul></ul></td><td><div style="white-space: pre-wra +p; overflow: scroll;">$VAR1 = bless( { &quot;.parameters&quot; =&gt; [], &quot;use_tempfile&quot; =&gt; 1, &quot;.etab&quot; =&gt; 1, &quot;.charset&quot; =&gt; &quot;UTF-8&quot;, &quot;.elid&quot; =&gt; 1, &quot;.fieldnames&quot; =&gt; {}, &quot;.cookies&quot; =&gt; undef, &quot;param&quot; =&gt; {}, &quot;escape&quot; =&gt; 1, &quot;.header_printed&quot; =&gt; 1 }, 'CGI' ); </div></td></tr><tr><td>CGI::Cookie-&gt;fetch</td><td><div style="whit +e-space: pre-wrap; overflow: scroll;">$VAR1 = {}; </div></td></tr></table><h1>And now %ENV</h1><ul> <li><strong>USERPROFILE</strong></li> <ul> <li>C:\Documents and Settings\Default User</li> </ul> <li><strong>PSMODULEPATH</strong></li> <ul> <li>C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\</li> ... Output Truncated Here... ... <li><strong>TMP</strong></li> <ul> <li>C:\WINDOWS\TEMP</li> </ul> </ul> </body> </html>

Is working with Cookies/CGI in Perl that much difficult a task?

Replies are listed 'Best First'.
Re^7: Cookie and Session
by aaron_baugher (Curate) on Nov 04, 2011 at 14:53 UTC

    If you copied his script and you're seeing all that in your browser, then go back to what I said above: your server is sending headers ahead of what your CGI scripts are sending (and apparently encoding your output as well). You'll have to fix that before your CGIs can work at all. Your web server shouldn't send any headers when it runs a CGI; it should let the CGI take care of that.

    Try this extremely simple CGI script. If you see anything in your browser other than "Hello, world!", you have a server problem. You should NOT see the Content-type line.

    #!/usr/bin/perl use warnings; use strict; print "Content-type: text/html\n\n"; print "Hello, world!";
Re^7: Cookie and Session
by Anonymous Monk on Nov 04, 2011 at 06:39 UTC

    Sir, Your codes give this output:

    Why do you think I would need to see it?

    Is working with Cookies/CGI in Perl that much difficult a task?

    Not if you have a basic understanding of the internet/computer programs