sub absent { my $str = shift; for (@_) { return 0 if $str =~ $_ } return 1; } my @must_not_be_there = ( '/bulletin/', '.css', 'formmail.', '/prosp/', '/calendar/', '/edit/', '/tmp/calendar2002-3/pgradh/regs/029.html', 'FalseIfJustThis', 'ButIfAlsoThisThenTrue' ); if (($ENV{'HTTP_REFERER'} && $ENV{'REMOTE_ADDR'} ne "129.215.67.96") && absent ($ENV{'REQUEST_URI'}, @must_not_be_there) ) { print "matches\n"; } #### && !(grep {$ENV{'REQUEST_URI'} =~ $_} @must_not_be_there ) )