foreach my $num (@Array){ print "---$num---\n"; print Dumper(%children); while (keys %children >= $max) { print "Haaaanging\n"; sleep 1; }