use CGI qw/:standard/; ... if (param()) { # form variables present } else { # display the form }