in reply to processing logic help

If you just need to process them in chronological order, you could sort them based on their modification times:
my @files = <*.txt>; @files = map { $_->[0] } sort { $b->[1] <=> $a->[1] } map { [ $_, (-M $_) ] } @files;
Gotta love that Schwartzian Transform.

You'll have to be in the appropriate directory for this to work, and you'll end up with @files containing a the filenames, sorted ascending by last modification time. You could do a simple addition and splice operation to pare down the list to the files you haven't used before.

It's a different approach, anyway.