in reply to thanks, i'm new. rtfm right? :)
$tempfile =~ s!\.[^\.]+$!!;
That matches everything after and including the last literal period in the filename, and gets rid of it.