in reply to Re^4: here doc and there doc: what's the difference? why does everyone seem to hate them?
in thread here doc and there doc: what's the difference? why does everyone seem to hate them?
In the poll, the difference between choices <<"here doc" and <<'there doc' is roughly the same as the difference between choices "doubles" and 'singles'.
Note that I voted for (against) <<"here doc" because I dislike the way they break proper indentation, are broken by changing indentation, are broken by invisible spaces (trailing spaces are often not even indirectly visible, unlike other whitespace), and are rather inflexible (can only be closed after a newline which often leads to clumsly interpolation tricks like @{[...]}).
But <<'there doc' has the virtue off being the only quoting mechanism in Perl that doesn't ever require \ to be escaped (the __END__ choice isn't really a quoting mechanism).
- tye
|
|---|