use v5.36; use feature qw/switch/; no warnings "experimental::smartmatch"; no warnings "experimental::for_list"; for my ( $opt, $val ) (%$opts ) { given ($opt) { when ('h') { HELP_MESSAGE(); } when ('v') { ++$verbose; } when ('r') { ++$recursive; } when ('c') { ++$confirm; } when ('f') { ++$force; } default { die "*** BUG: no handler for -$opt.\n"; } } }