in reply to Simple file editing problems

Use  chomp in the input variables, in order to remove the "newline" or "enter" character.

for example:

$fileext = <STDIN>; chomp $fileext;