1, the original title
2, the code
open IN, '<', 'File1.txt' or die 'The file does not exist!'; open OUT, '>', 'File2.txt' or die 'The file does not exist!'; while(<IN>) { chomp; #print("$_\n"); @temp = split(/ /,$_); #print("$temp[1]\n"); $temp_out = "placeInstance $temp[1] $temp[3] $temp[4] $temp[2] -fixed"; print("$temp_out\n"); print(OUT "$temp_out\n"); } close IN; close OUT;