use CGI qw(:standard); $page = param('page'); # do some header stuff here if ($page eq 'list_products') { # deal with listing products print "......" } elsif ($page eq 'view_product') { # deal with viewing products } elsif ($page eq 'edit_product') { # deal with editing products } elsif ($page eq 'save_product') { # deal with saving product changes } else { # display a default page } # do some footer stuff here