my ($top_file) = reverse sort { ($a=~/\$(\d+)$/)<=>($b=~/\$(\d+)$/) } readdir(DIR);