in reply to problem in matching the filename

The code above worked for me once I added a #!/usr/bin/perl to the top of it. So it looks like it works to me. What's the problem exactly?