Could you please correct my code below.
#!/usr/local/bin/perl
open (MYFILE, '>>data.xml');
print MYFILE "<?xml version="1.0" encoding="UTF-8"?>\n";
close (MYFILE);
Updated.
#!/usr/local/bin/perl
open (MYFILE, '>>data.xml');
print MYFILE '<?xml version="1.0" encoding="UTF-8"?\>'."\n";
print MYFILE '<?xml version="1.0" encoding="UTF-16"?\>'."\n";
close (MYFILE);
output: working well now.
<?xml version="1.0" encoding="UTF-8"?\>
<?xml version="1.0" encoding="UTF-16"?\>
BUT.
#!/usr/local/bin/perl
open (MYFILE, '>>data.xml');
print MYFILE '<?xml version="1.0" encoding="UTF-8"?\>'.'\n';
print MYFILE '<?xml version="1.0" encoding="UTF-16"?\>'.'\n';
close (MYFILE);
Output: # error format with \n
<?xml version="1.0" encoding="UTF-8"?\>\n<?xml version="1.0" encoding="UTF-16"?\>\n