in reply to Specifying filename

There is no need to take the variable out of the quoted area: open (XMLFILE,">c:/Perl_Tests/$filename.xml"); should work fine.