package ... ; BEGIN { for my $opt ( qw< l i s t > ) { # Normalize. my $sub = lc $opt; $sub =~ tr/-/_/; no strict 'refs'; *$sub = sub { # get|set a variable based on number # (and/or kind, value) of arguments passed. }; } }