use strict; use warnings; use CGI; if($ENV{REQUEST_METHOD} eq 'GET') { # print form with method 'POST' and submit button } else { # print the rest of the page }