
$getTZ = "$path"."\\".'contents.xml';
further perl syntaxes are not recongnised.
This is because your are dereferencing the slash (\). I used \\, so that one slash dereference the other. But that is not happening, instead you are dereferencing the double quote ", which is making the rest of the program under the same line.