# but have you tried this? foreach (sort ) { print; } while (sort ) { print; }