sub configure { my $setting_a= undef; my $setting_b= undef; { run a bunch of things setting combinations of a or b , last } do someting with settings a and b }