use CGI qw(:standard); if(param()) { if($a=param('a')) { /* code for url parameter a */ } } else { /* generate html form when not called with parameters */ /* the form submit url points to itself (the .pl) */ }