use vars qw(%Config); # "global" ist dafuer manchmal besser my $cgi = CGI->new(); my $action = $cgi->param('action') || 'default'; %Config = ( default => { subroutine => \&Default, ... }, action1 => { subroutine => \&Action1, ... }, action2 => { subroutine => \&Action2, ... }, ); if (exists $Config{$action} and exists $Config{$action}->{subroutine}) { $Config{$action}->{subroutine}->($cgi, ...); } else { # call default, or errorhandling, or whatever $Config{default}->{subroutine}->($cgi, ...); } # else