foreach my $tags ( sort { (split /,/,$a)[1] <=> (split /,/,$b)[1] } keys %tag ) {