You might want to try out using templates for this kind of work as it allows you to separate the HTML from your code. Have a look at HTML::Template and Template Toolkit - the former is probably easier to learn but the latter is very powerful. Using HTML::Template you would create a template file like this:

example.tmpl

<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1 +, maximum-scale=1"> <link type="text/css" rel="stylesheet" href="../hideo/bootstrap/cs +s/bootstrap.min.css"> <!-- etc. fill in rest of head elements --> </head> <body> <!-- RIGHT AFTER <body> TAG --> <script type="text/javascript" src="../hideo/js-plugin/jquery/jque +ry-1.10.2.min.js"></script> <script type="text/javascript" src="../hideo/JQuery/jquery.cycle.a +ll.2.74.js"></script> <!-- this will be replaced --> <TMPL_VAR NAME=CONTENT> <!-- JUST BEFORE </body> TAG --> <script type="text/javascript" src="../hideo/bootstrap/js/bootstra +p.js"></script> <script type="text/javascript" src="../hideo/js/custom.js"></scrip +t> </body> </html>
Then in your perl script you pass the file to the template engine, and populate it with the other content you want on the page:
use HTML::Template; my $file = '/path/to/example.tmpl'; my $template = HTML::Template->new( filename => $file ); # do all the work to create the content my $content = "Start of Content"; # ... # pass content to the template $template->param( CONTENT => $content ); print "Content-Type: text/html\n\n"; print $template->output;

In reply to Re: How To Use Bootstrap Code in Perl Script? by tangent
in thread How To Use Bootstrap Code in Perl Script? by glennpm

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.