my @ip = qw(123.43.25.1.34, 95.46.3.56.3, 35.76.21.34.3); my $x = 0; foreach (@ip){ if($ENV{'REMOTE_ADDR'} eq $_){ print "Du bist gesperrt!"; last; } }