in reply to glob a folder of images, and open text doc, find the matches and move the images.
Dont assume your program is correct
This is how your rename files, make a list of renames, then you human review the list for any mistakes, then finally do the rename
Re: how to deal with incorrect command line argument
do not attempt renaming but first generate a list of moves and then review that list
In Section
Seekers of Perl Wisdom