display_login_form() unless logged_in(); display_admin_view() if is_admin(); display_normal_view(); sub logged_in { # check for a cookie # check for a 'pass' parameter if there's no cookie # create a cookie if there's a 'pass' parameter but no # cookie already # return true if either one is valid } sub display_login_form { # print a form that asks for the 'pass' parameter # exit; } sub is_admin { # check if the given password matches the admin password } sub display_admin_view { # show the administrative view } sub display_normal_view { # show the normal view }