use CGI qw/:standard/; if (param('Action') and param('Action') eq 'Run Foo') { foo(); } elsif (param('Action') and param('Action') eq 'Run Bar') { bar(); } elsif (param('Action') and param('Action') eq 'Store Event') { store_event(); } else { print header, start_html('Ack!'), h1 'you have to call this from the form!', end_html; }