use strict; use warnings; use Getopt::Long; my @o_list; unless ( GetOptions ("o=s" => \@o_list) ) { print "GetOptions had problems parsing ARGV!\n"; } print "List of -o things: ", join(", ", @o_list), "\n"; print "Unparsed arguments: ", join(", ", @ARGV ), "\n";