If the form itself is on an insecure page, and you want the form to be submitted to a secture script, you can simply set the action= to the HTTPS URL.As for redirecting to a secure site, CGI.pm's redirection works fine for HTTPS URLs: print $query->redirect('https://...') unless ($cgi->https());