in reply to Sorting a list of filenames

I confess to being confused by the use of map here and scared by the apparently endless loop, which probably means i haven't understood something. Here's how i would do the main bit, anyway:

for (@sortedbus) { push (@oldbus,$_) if (m/^(\d)+?/ && make_nasty_date($1) < $today); }

Which should give you a sorted list of the right files in @oldbus. make_nasty_date is standing for whatever mechanism you're using to convert yyyymmdd into seconds-since-epoch, assuming that's what you're doing.

ps. i expect there are a hundred things wrong with the regex, so let's say it's assuming filenames in the right format.