my $package_sub = sub _suppen_paket { ... }; my $profile_sub = sub _prof_feile { ... }; my %switch = ( 'package' => $package_sub, 'profile' => $profile_sub, ); $switch{ $site->{ FILETYP } }->();