use Getopt::Long; sub simple_call { my @params = qw( animal fish insect ); my $self = shift; local @ARGV; push @ARGV, '--'.shift, shift while @_; GetOptions( \(my %opt), map $_.'=s@', @params ); # now use %opt. each value is an arrayref. }