my ($name, $dir, $ext) = fileparse($filepath, '\..*');