> cat 714766.pl #!/usr/bin/env perl use strict; use warnings; use Data::Dumper; use Getopt::Std; #print 'ARGV ',Dumper(\@ARGV); my $test = 1; my %opt; getopt('st',\%opt); #print 'opt ',Dumper(\%opt); if ($opt{'t'}) { $test = 1; ## testing #print "set test=1 again\n"; } elsif ($opt{'s'}) { $test = 0; ## not testing #print "set test=0\n"; } #print "test=$test\n"; if ( (!(defined($opt{'s'}))) && (!(defined($opt{'t'}))) ) { print "neither -t or -s used\n"; } else { print "either -t or -s used\n"; }