sub insert { my %cookies = fetch CGI::Cookie; # retrieve the user_id cookie my $section = $cookies{"id"}; if($section){ # If the cookies has been set send them back somewhere. &display; } get all the values from form ....... do the inserts done with insert... #call display sub to user &display; } # end sub insert