Corrected complex variable check in Template.pm parsing logic