in reply to How to extract the 4 number in the filename?

You should be able to work this out for yourself. Read perlretut and have a look at Regexp Quote Like Operators in perlop.

Post back to this thread if you still can work it out, showing us what you've tried.

Update:

When I first read your node, I thought you already had a list of filenames, now I'm not so sure. So, if you need to read a directory to get the filenames, you can use glob (or opendir and readdir).