You don't need a heredoc when you have the text in a variable already.
use this instead
->Part({
ctype => 'text/html',
disposition => 'NONE',
msg => $var})
| [reply] [d/l] |
$var = 'hello world';
print <<'END';
$var
END
and this
$var = 'hello world';
print <<"END"
$var
END
Assuming you really do want a 'heredoc' here, you want the second kind.
Don't put stars in the heredoc terminator, that's ugly. If it doesn't stand out enough already, you need a different editor.
END
| [reply] [d/l] [select] |
Beauty is in the eye of the beer holder! I use the "*END*" all the time. Not just that it stands out more, but it's also less likely to appear in the stuff I'm quoting. And my editor does highlight the heredocs just fine, thank you.
Jenda
Enoch was right!
Enjoy the last years of Rome.
| [reply] |
I was convinced I could counter with a rewrite of Chandanperl's code with a typo or two and get it to compile and produce something totally unexpected ( using an empty binary shift <<, a glob *END and the glob of $OFS, *, thrown up against the $var in the example), but I haven't managed it yet.
This was the basis of my argument about the 'ugliness' of the terminator - if it looks enough like a completely different piece of valid perl, and you have to think for a moment to work out how it will be parsed, I call it ugly. Since I can't support my argument with a concrete example, I'll have to let you off - this time! :)
Personally, I usually use a long string as a terminator, since I only have to type it twice.
| [reply] |