my %act = ( 'view.x' => \&view , 'invite.x' => \&invite ); foreach ($query->param()) { $act{$_}->() if defined $act{$_}; } #danger, will robinson: I don't think $query->param() exists in old versions of cgi.pm