http://www.perlmonks.org?node_id=796772


in reply to parse file name

File::Basename