for (sort keys %playlist) { print TEST "$playlist{$_}\n" } for (sort keys %filelist) { print TEST2 "$filelist{$_}\n" }