use strict; my $start=' '; my @key=("1","2","3","4","5"); my ($file_handle,$output_file); $output_file=".xml"; for(my $i=0;$i<$#key;$i++) { my $val=$key[$i]; $file_handle=$val; $output_file=$val.$output_file; open($file_handle,'>:utf8',"$output_file"); print $file_handle $start."\n"; print $file_handle "\t\t".'
'."\n"; close $file_handle; } #### Can't use string ("1") as a symbol ref while "strict refs" in use at D:\senthil\ xmlgeneration\xmltest\file.pl line 12.