MAKE_CLASSES: printf $temporaryLog "%s : Enter loop %d keys ...", scalar localtime(), scalar keys %c; foreach my $subclass ( sort { length $a <=> length $b } keys %c ) { ... } printf $temporaryLog "exited\n";