sub isSecure() { return lc($ENV{'HTTPS'}) eq 'on'; } sub getProtocol() { return isSecure() ? 'https' : 'http'; }Example use:
if (isSecure()) { print "Secure connection\n"; } else { print "Non-secure connection\n"; }
sub isSecure() { return lc($ENV{'HTTPS'}) eq 'on'; } sub getProtocol() { return isSecure() ? 'https' : 'http'; }Example use:
if (isSecure()) { print "Secure connection\n"; } else { print "Non-secure connection\n"; }