-2

I'm quite new in Perl. I'm using here document to print out something in our UI. I could not find a way to add HTML code in here document.

my $str = <<"EOF";
<h1>Something</h1>
EOF

Please help. Thanks

Steve S.
  • 71
  • 6
  • 3
    This code should just work... What is the problem that you are having with it? – GMB Oct 18 '19 at 08:07
  • 3
    @collapsar: Please don't recommend unquoted heredoc delimiters. Using single or double quotes makes it clear to your maintenance programmer (which might well be you in three months time) whether or not variables will be interpolated in the string. – Dave Cross Oct 18 '19 at 08:37
  • 1
    @SteveS: This code works. Or, at least, you will have HTML in `$str`. The problem is probably in how that string is then displayed. And we can't help solve that problem until you show us that part of the code. – Dave Cross Oct 18 '19 at 08:38
  • @DaveCross Thank you for the advice, deleting the comment – collapsar Oct 18 '19 at 10:04

1 Answers1

0

Thanks, the UI framework did not interpret the embedded HTML, thus like @DaveCross and you guys said, the embedded HTML should work.

Steve S.
  • 71
  • 6