my $i=0; my $solldatei = 'a.txt'; my $istdatei = 'b.txt'; open my $filehandle, '<', $solldatei; open my $filehandle1, '<', $istdatei; while( my $ziele = <$filehandle> ) { @test = split(/;/, $ziele); while( my $ziele1 = <$filehandle1>) { @test1 = split(/;/, $ziele1); print @test[0]; print " @test1[0] \n"; if(@test[0]eq@test1[0]) { print "@test[0]"; print " und"; print " @test1[0]"; print " COOL!\n"; } } } close $filehandle; close $filehandle1;