How do I identify the protocol (http vs. https) using Perl's CGI.pm

I'm editing a Perl CGI application that does special processing when run under HTTPS.

Right now, I'm trying to detect it by manually looking for 'https://' in the request URI:

    my $is_secure = $cgi->request_uri =~ m{^https://};

Is there a slightly cleaner way of doing this?

7
задан Anirvan 7 March 2011 в 18:01
поделиться