use constant ERR_LOG => '/var/log/httpd-error.log'; sub get_idiots { open(FH, '<', ERR_LOG) or die "Can't open " . ERR_LOG . ": $!\n"; my %idiots; while(my $line = ) { next unless $line =~ /cmd\.exe/; chomp $line; $line =~ /\[client ([^\]]+)\]/; $idiots{$1} = 1; } close(FH); return %idiots; }