use strict; use warnings; use Getopt::Std; getopts 'st', \my %opt; my $test = $opt{t} || !$opt{s}; unless( $opt{t} || $opt{s} ) { print "Reading from site test file\n"; open my $t, '<', 'test' or die "Can't open site test file: $!"; local $_ = <$t>; print; $test = ! /0/ ### I would rather say $test = !!$_ }