Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm brand new to pearl. I've tried to understand it but I don't have enough time. I just want simple to use code that I could place in my html. I want code that would allow users to create their own name and password to log into a special area of my site.

Replies are listed 'Best First'.
Re: Password Protection
by Jazz (Curate) on Oct 29, 2001 at 04:13 UTC
    Since it sounds like time may be lacking for you, a premade solution may best serve your needs.

      Frankly, I would be rather wary of using those. It's an unfortunate fact that 99% of cgi programs on the web roll their own parameter parsers, don't use strict, and so on. If one were to suggest a premade solution, make it from someone a with better coding habits. Heck, one might even learn some Perl in the process..

      Update: Toned down the negativity about the above-mentioned URL, on the basis that there is a non-zero chance that at least one of them might be written correctly.

      perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^+*`^ ve^#$&V"+@( NO CARRIER'

        The quality of scripts there is about the same as those listed in CGI Resource Index. Of course, they're not all bad (You'll find NMS listed there for example), but you should exercise caution wherever you download your copy-paste scripts from (including perlmonks).

        I don't mean that in a bad way, but it's prudent.

        Simon Flack ($code or die)
        $,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
        =~y'_"' ';eval"die";print $_,lc substr$@,0,3;
Re: Password Protection
by cfreak (Chaplain) on Oct 29, 2001 at 20:42 UTC
    If you are running Apache it would probably be much simpler to use HTACCESS on the area of your site that you want to protect.