if there are submitted form variables then perform the requested action else display the form end if #### use CGI qw/:standard/; ... if (param()) { # form variables present } else { # display the form }