I've found that you can't interchange the CGI.pm and raw form code
Why would you want to? It's much safer to let CGI.pm take care of it for you.
I think that you could solve your problems by upgrading your code to use CGI.pm.
My thoughts are mine and mine alone. They did not originate with the voices in my head. Do not listen to what they say, it's all lies.
| [reply] |
The meat of the program is working like a charm and does not use CGI.pm. To convert it would mean days and days of work that I don't have time for...I agree that CGI.pm is very cool, but we didn't get it approved for installation until I'd gotten most of the project working.
I hate to think that I can get a database flatfile script to work....XORing passwords and validating entries without CGI.pm but can't get a simple cookie to set ?
TexasTess
| [reply] |
While red tape is uncool, we're stuck with the current state of affairs. One strategy is printing set-cookie headers, like this:
Set-Cookie: VarName=Value;path=/;domain=.mydomain.com
Of course, this does absolutely nothing in the way of fine details like escaping values, etc. (The CGI module does all of this automatically when used correctly.) Escaping variable names is particularly unstable: I've seen cases where different versions of IE/NS had different ideas about whether to stomp underscores in variable names before sending them.
Another idea to consider is a very minimal use of the CGI module. That is: refactor the acquisition of variable/cookie names and values, and use print $q->header and its variants, and $VarName = $q->cookie(...) to properly construct the cookies...but leave all generation of HTML proper as-is (print to STDOUT is typical). I personally am accustomed to editing HTML in a programming file editor rather than a GUI environment, so I have no immediate pressure to use any of the HTML-generating shortcuts.
| [reply] [d/l] [select] |
| [reply] |
Do you mind if I ask what version of perl you're using? I seem to remember CGI.pm being added to the core distribution somewhere around 5.004, which was like 5 years ago. Any reasonably recent distribution of perl should already come with CGI.pm installed....
-Blake
| [reply] |