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


in reply to Removing dots

Just because I felt like doing something different than an RE:
$origfile = shift; @chunks = split(/\./, $origfile); $ext = pop @chunks; $filename = join("", @chunks, ".$ext"); rename $origfile, $filename;