This is the title ... 12,34,0 This is another title One more 56,78,0 ... -99,-88,0 #### foreach (@kmlFile) { if (m/(.*)<\/name>/) { %{$1} = (name => "$1## %This is the title = ( name => "This is the title "12,34,0", ) %One more = ( name => "One more", coordinates => "56,78,0", )