#!/usr/bin/perl -w use strict; use warnings; my %hash = (foo => defined, bar => defined, foobar => defined,); print "Altes \"Array\": " . (join ' ',keys (%hash)) . "\n"; local $/ = "\n"; while () { chomp; print "Untersuche $_..."; if (exists $hash{$_}) { print "haben wir schon\n" } else { print "nehmen wir\n"; $hash{$_} = defined } } print "Neues \"Array\": " . (join ' ',keys (%hash)) . "\n"; __DATA__ 0foo foo bar foofoo barbar foobar