http://www.perlmonks.org?node_id=128599


in reply to form buttons

Give all the buttons the same name but different values.
<input type="submit" name="action" value="button1"> <input type="submit" name="action" value="button2"> <input type="submit" name="action" value="button3">
Then in your CGI the action parameter will be 'button1' or 'button2' or 'button3' depending on which is pressed.
my $query = CGI::new(); #assign value to $action my $action = $query->param('action');
you can then say
if ($action eq 'button1') { #do your thing }elsif ($action eq 'button2'){ #do another thing }