my @tmp_ary = keys %$data; while(my $item = shift @tmp_ary) { do stuff... }