Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
What you'd write, depends on what you want to do. If that conditional is supposed to be an independent statement, then you put the semicolon there in the middle. Same way as you'd do in print "foo\n"; if (...) { ... }. If it's supposed to be a postfix conditional, then it's part of the same statement, and you don't put the semicolon in there. Same way as in print "foo\n" if .... There's nothing odd with the here-doc there, it's just a different-looking quote-like operator, same as '...' or qw/.../.
$x
is true?print "foo\n"; if (...) { ... }
. If it's supposed to be a postfix conditional, then it's part of the same statement, and you don't put the semicolon in there. Same way as inprint "foo\n" if ...
. There's nothing odd with the here-doc there, it's just a different-looking quote-like operator, same as'...'
orqw/.../
.