Perl - A way to get only the first (.txt) filename from another directory without loading them all?
问题 I have a directory that holds ~5000 2,400 sized .txt files. I just want one filename from that directory; order does not matter. The file will be processed and deleted. This is not the scripts working directory. The intention is: to open that file, read it, do some stuff, unlink it and then loop to the next file. My crude attempt does not check for only .txt files and also has to get all ~5000 filenames just for one filename. I am also possibly calling too many modules? The Verify_Empty sub