$ perl use strict; use warnings; my %test = ( foo => 'bar', foo1 => 'bar1', foo2 => 'bar2', foo3 => 'bar3', ); my @keys = keys %test; foreach my $temp (@keys) { print "Bearbeite '$temp'\n"; delete $keys[2]; } __END__ Bearbeite 'foo3' Bearbeite 'foo' Use of uninitialized value $temp in concatenation (.) or string at - line 12. Bearbeite '' Bearbeite 'foo1'