in reply to $ENV{HTTPS} not consistent
$myself = $query->url(); [download]
If you're going to use CGI.pm, then it would be quicker to use the https method (or function, if you add :ssl to the import list) to see if SSL is enabled...
if ($query->https) { ... } [download]
--k.