1 2 3 4
my @video_ids = sort { ( $new_first ? $tmp{$b}{published} cmp $tmp{$a}{published} : $tmp{$a}{published} cmp $tmp{$b}{published} ) || $tmp{$a}{title} cmp $tmp{$b}{title} } @$ids;
1 2 3 4 5
my @video_ids = sort { $tmp{$a}{published} cmp $tmp{$b}{published} || $tmp{$a}{title} cmp $tmp{$b}{title} } @$ids; @video_ids = reverse @video_ids if $new_first;