in reply to reg access of stored session variable
I won't repeat what has already been said about your database code but read it again, it's important.
In the first piece of code you are doing something odd:
I don't think that it will cause a failure but you might want to examine the generated headers to be certain. You really only the second line.print $cgi->header; print $session->header;
Moving on to second piece of code...
What is use sub test(); supposed to do? I'm not familiar with the sub pragma. Is it one you wrote or should that really be use subs qw(test);?
You cannot print anything in a CGI program before printing the headers but you've done just that. Move the print "<html><head>"; after the call to print $session->header;.
|
|---|