# When sorting lists of files, I want the index file to always come first. if ($c =~ /^index\./) { return -1; } elsif ($d =~ /^index\./) { return 1; }