if( my $auth = $ENV{HTTP_AUTHORIZATION} ){ my ($basic, $cred) = split /\s+/, $auth; ( $ENV{HTTP_USER}, $ENV{HTTP_PASS} ) = split ":", MIME::Base64::decode_base64($cred); }