in reply to Specifying filename

In addition to the advice already provided, consider replacing your sequence of print statements by a much simpler and less verbose HERE doc:
open my $fh, '>', $filename or die "Can not open file $filename: $!"; print $fh <<"EOF"; <?xml version="1.0" encoding="UTF-8"?> <XML TAGS> <SERIES>$series</SERIES> <ETC>$etc</ETC> <ETC>$etc</ETC> </XMLTAGS> EOF close $fh;

That being said, I second the recommendation to consider using a CPAN module for creating the XML file.