in reply to How to extract the filenames in an array
Most likely you want to use something like File::Basename to manipulate file names and paths.
Nice to see you are using warnings. You will find that strict (use strict;) helps a lot too.