"I'm not sure debating one bit of sample HTML which was shared to demonstrate something completely different helps with the original question about heredocs or with the subsequent divergence into templates."

My reply was the first to suggest templating, and commented on this as a side note. Printing literally each line of HTML at a time, substituting values within blocks of code like that is arcane. If it works for you it isn't a problem obviously, as mentioned more than once now, however when posting clunky things on a forum to help people learn how to do things better, expect someone to flag it up. Which shouldn't be surprising given previous conversations about modern perl and what it can do. From experience of writing and maintaining clean interfaces in sane ways, the learning curve isn't too steep and each small thing you learn to do better makes life a lot easier. Booking.com may be doing this to satisfy some other problem, as LanX has mentioned certain JavaScript UI toolkits do weird things. 22 requests pulling in 2MB of JavaScript, I'm not going to bother delving into any of that bloat. JavaScript is sometimes a necessary evil best used sparingly but just all too often misused these days, hence the bloated interwebs.


In reply to Re^11: Here documents in blocks (why templates) by marto
in thread Here documents in blocks by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.