This will result in the scalar $dateStamp containing "20130101" and $basename containing "Customer100". The presumption I made (you didn't specify otherwise) was that your filenames all have the extension "imp" and as long as they do the regex I supplied you will work. I leave it as an exercise in intellect for you to modify the regex if there are other extensions involved.