I don't suppose there's $noext is there? to take the extension off a filename

could use $gettok. $noext might just be tidier