in reply to Getopt::Long Validation

Yet another way:

#!/usr/bin/perl -w use strict; use Getopt::Declare; use vars '$range'; $range = 0; my $opts = Getopt::Declare->new(<<'SPEC') || die <<USAGE; -ip <ip:s> IP range [required] {$range = $ip;} -file <infile:s> get range from file [required] {local @ARGV = $infile;chomp($range=<>)} <infile:s> [ditto] [mutex: -file -ip <infile>] SPEC $0 -file filename | -ip range | filename USAGE print $range,$/;