my %opt; my @string_opts = qw(name foo|goo bar); GetOptions(\%opt, qw(help long), map { "$_=s" } @string_opts) or die; for my $oname (@string_opts) { $oname = (split /\|/, $oname)[0]; # handle alternate names if ( (exists $opt{$oname}) and ($opt{$oname} =~ /^-/) ) { die "Option $oname requires an argument\n"; } }