#!/usr/bin/perl
opendir DIR, ".";
foreach(readdir(DIR)){
print "$_\n";
if(/\.ip$/){
        $ehd = $_;
        open INPUT, "$ehd";
        @ips = <INPUT>;
        close INPUT;
        foreach $ip (@ips){
		print "   $ip\n";
                chomp($ip);
                if($ip eq $curip){
                        $body = "<h1>Tällä ip:llä on jo äänestetty</h1>";
                }
        }
}
}
closedir DIR;

print $body;
