## my $query = CGI::new(); #assign value to $action my $action = $query->param('action'); ##
## if ($action eq 'button1') { #do your thing }elsif ($action eq 'button2'){ #do another thing }