in reply to Getopt::Long Validation

for the mix, i do it like this...

my @switch_list_files = (); my @switches = (); GetOptions ( 'list=s' => \@switch_list_files, 'switch=s' => \@switches, ) or die Usage(); @switch_list_files = split(/,/, join(',', @switch_list_files)); @switches = split(/,/, join(',', @switches)); foreach my $file (@switch_list_files) { if (open F, "<$file") { while (<F>) { chomp; push @switches, (split /\s/, $_, 2)[0]; } close F; } else { die "no readum $file: $!\n"; } } die "need some switches!$/" unless @switches; __END__ $ prog -s 192.168.254.1 -s 192.168.254.2,192.168.254.3 -list foo.list +-f bar.list,bat.list $ cat foo.list 192.168.250.1 rest is ignored 192.168.250.2 ditto

which takes any number of switches in any number of files or specified by any number of options.