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

I'm writing a PerlAccessHandler and I'm trying to determine if a user is coming over SSL. It's my assumption the best way to do this is to:
sub handler { my $r = shift; my $uri = $r->parsed_uri; my $scheme = lc($uri->scheme); if ($scheme eq 'https') { ... } ... }
My major problem is that $uri->scheme is returning nothing. Has anyone seen this problem or have a better solution?

Replies are listed 'Best First'.
Re: Apache::URI conundrum
by Chmrr (Vicar) on Sep 20, 2002 at 19:15 UTC

    There was some heated discussion of this on the mod_perl list a while back, and the best answer has, of course, found its way into the Guide already.

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