#!/usr/bin/perl -w use strict; use feature 'switch'; #only works in newer versions (5.10?) of Perl use CGI qw/ :all /; | | Handwaving here. | my $cgi=CGI->new(); my $action = $cgi->param('action'); given ($action){ when('delete'){ my $row_id = $cgi->param('row_id'); | insert code here to delete a row based on its id } when('update'){ my $newname = $cgi->param('newname'); if ($newname) { # non-null input only | code here to execute update } | }