use CGI; my $q = CGI->new; my $bA = $q->param('button_A'); my $bB = $q->param('button_update'); if($bA eq "whatever") { # do whatever } if($bB eq "Update") { # do update stuff here }