in reply to reading 2 lines at a time using perl

Something like this, perhaps?

#!/usr/bin/env perl use strict; use warnings; my ($first, $second); while(($first = <DATA>) && ($second = <DATA>)) { print "1: $first", "2: $second\n"; if($first eq $second) { print STDERR "Duplicate line $first"; } } __DATA__ Hello World Hallo Welt Servas Woit foo foo
"You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."