Except that your example is not the same. Yours has a leading space that mine doesn't have, and mine has a trailing newline that yours doesn't. Those are things that can be more easily spotted with a heredoc.
On the other hand, some things can be tricky to do with a heredoc, like ending a multi-line string without a newline. So each method has its own best uses.
Aaron B.
My Woefully Neglected Blog, where I occasionally mention Perl.
In reply to Re^3: $foo = << "END"
by aaron_baugher
in thread $foo = << "END"
by akagrawal3
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |