Your problem is that you are creating closures in your script. These are not a big problem under CGI because the interpreter exits every time, but under Apache::Registry you have to follow better progamming practices.
Look at your login sub. You use the variable %ARGS in it, but don't pass it to the sub. You are taking advantage of the fact that %ARGS is declared in a higher scope and is thus visible to your subroutine. However, after the first time this gets executed the %ARGS used in the login sub is private and will no longer change.
To fix this, you need to explicitly pass all variables to your subs. Instead of saying &login, say login(\%ARGS) and then read that in at the beginning of the login sub. This is a good programming practice, and you should be doing it anyway.
Note that all of this is explained in the documents that merlyn pointed out to you in the very first post in this thread. You can also read about it in the mod_perl guide.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.