#!perl -w

print"Eingabedatei?\n";
$infile= <STDIN>;
chomp($infile);
open(INPUT, "<$infile");
print"Ausgabedatei?\n";
$outfile= <STDIN>;
chomp($outfile);
open(OUTPUT, ">$outfile");

while($line = <INPUT>){
	while($line =~ /(\b[A-Z][a-z]*\b)\s*(\b[A-Z][a-z]*\b);/g){
		print OUTPUT "$2, $1\n";
	}
}	

close(INPUT);
close(OUTPUT);