Be aware that the dot, ".", is a regular expression metacharacter meaning match any character (with a caveat, have a look at
perlre). If you want to match the literal ".output" but not, say, "toutput" then you need to escape the dot with a backslash.
$name =~ s/\.output//i;
I hope this is of use.
Cheers,
JohnGG