in reply to Specifying filename
When you read a line from user input, the newline character is still at the end of the line. Some filesystems have problems with creating a filename that contains a newline character. So you should remove that character using the chomp function:
chomp $filename;
Also, it is a very good practice to check whether your open() calls succeed or not, and to output a relevant error message:
open XMLFILE, '>', $filename) or die "Couldn't create '$filename': $!";
|
|---|