my $action = "do_" . $CGI->param('action'); my $to_do = new INVOICES; $to_do->can($action) ? $to_do->$action() : defscreen();