in reply to Error coming while using Use Strict
you don't need different handle Please find the updated code
use strict; my $start='<?xml version="1.0" encoding="utf-8"?> <MultifamilyProperty xmlns:xsi="http://www.w3.org/2001/XMLSchema-insta +nce" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'; my @key=("1","2","3","4","5"); my ($file_handle,$output_file); for(my $i=0;$i<$#key;$i++) { my $val=$key[$i]; print "val:$val\n"; my $output_file=$val.".xml"; print "out : $output_file\n"; open(OPEN,'>:utf8',"$output_file"); print OPEN $start."\n"; print OPEN "\t\t".'<Address>'."\n"; close OPEN; }
|
|---|