http://qs321.pair.com?node_id=66520

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

Hello everybody!

The following script is written in PHP and does basic http authentication.
Now I have to do this in Perl, but I don't know how to do it.
Actually i'm a real Perl beginner :-(
Can anybody help me or tell me where I can find written help or code examples?

<? if(!isset($PHP_AUTH_USER)) { Header("WWW-Authenticate: Basic realm=\"myrealm\""); Header("HTTP/1.0 401 Unauthorized"); echo ("Acces denied"); exit; } else { if ($PHP_AUTH_USER!= "user" || $PHP_AUTH_PW!= "password") { Header("WWW-Authenticate: Basic realm=\"myrealm\""); Header("HTTP/1.0 401 Unauthorized"); echo ("Acces denied"); exit; } } ?>

Thanks in advance!

Sven Rudolph

P.S. Sorry if this is a FAQ.

Edit: chipmunk 2001-03-22