Thanks a lot!
Your answer has helped me to start to move forward on this question. Very interesting links - that now is necessary for me
Dominique Quatravaux wrote:
There exists a lot of such modules on the CPAN already (http://www.cpan.org/) that do that. Why not try them? There are a couple of them listed at http://perl.apache.org/docs/1.0/guide/security.html#Apache__Auth__modules
First of all because it is more interesting to me to make it most. But for production, certainly I shall use existing and stable modules.