my ($base, $ext) = map { reverse } split '.', reverse($filename), 2;