From: Irfan Sayed > I need to print some string into the file. > the string is like this : "<?xml version="1.0" encoding="UTF-8"?>" > > i have written code like this : > print MYFILE "<?xml version="1.0" encoding="UTF-8"?>\n" where MYFILE is a file > handler. > > if i run this code , it is giving so many syntax errors. > any advice please
You can't have unescaped quotes in a quoted string. Try this: print MYFILE "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; or this: print MYFILE '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; Bob McConnell -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/