<- you need to type in these tags exactly as shown # xml data: abc <-- then you can type these exactly as shown. xyz # html data:

ABC

xyz

#### open(F2,""); my $xml_list1="(.*)\.html"; # here the data enclosed inside the parentheses also appears when # printed. I want say the file name is "abc.html" so i want to keep # "abc" as interchangeable, so that i dont need to write/modify the # code if any filename other than abc.html occurs. close F2; #print $xml_list1."\n"; foreach my $f (@filenames) { #print $f."\n"; open(F1,""); my $data=join("",); close F1; my $filename=substr($f,0,index($f,'.')); my $xml_list=$filename.".xml"; while($xml_list=~m//ig) # the code doesn't enter the while/if loop, seems that it finds some # error in reading the filename $xml_list, but i tried using # $xml_list1 too... but still the loop doesnt work.