chomp last newline in heredoc and use &P5Bool in conditions