Good day, keys look like: Dowda_23241506142001 This is wrong, but not sure how the syntax is, Where are $a,$b coming from, I thought of a sub, but how do assign $a, $b foreach my $key (sort { /_(\d+)$/; $a <=> $b } (keys %subjects)) { # /_(\d+)$/ grabs the number at the end of the string, what about: foreach my $key (sort { s/_(\d+)$/$1/; $a <=> $b } (keys %subjects)) { Thanks for your help on this. Dave
- Re: sort by number... David Gilden