$out .= LJ::ehtml(join ', ', sort { $a cmp $b } map { $_->{name} } (values %$tags)[0..9]);
$out .= LJ::ehtml(join ', ', (sort { $a cmp $b } map { $_->{name} } values %$tags)[0..9]);
If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org
Other options:
no subject
(Also, added the missing comparison function to your sort, assuming you want string ordering. Adjust as needed.)