#!/usr/bin/env perl use strict; use warnings; my ($first, $second); while(($first = ) && ($second = )) { print "1: $first", "2: $second\n"; if($first eq $second) { print STDERR "Duplicate line $first"; } } __DATA__ Hello World Hallo Welt Servas Woit foo foo