maybe i am recalling back to my php book or maybe i've been editing my named.conf a bit too frequently, but if i want to simply pull a snippet of code into my current script, is the best manner of doing so through:

require 'snippet.lib';

perhaps old habits die hard, but for some reason, it just feels like this should be include or something.

actually, let me give my case in point and this could stem in a different direction. i have a cgi script that generates html content (i am not using use CGI; i am just not there yet). anyway, my outside snippet.lib is really just a portion of html code that will change frequently and i want to be able to let the html dudes make their changes without freaking out over seeing so much perl code. so its going to look like:

print<<TOC; <table> <tr> <td>blah</td> </tr> </table> TOC

not really a whole lot of perl here, but just a way to keep my stuff mine and their stuff theirs.
so am i going down a road taken by all beginners trying to be crafty that ends in a dark alley? or am i getting in done in a non-optimal but okay way. suggestions are more than welcome, but CGI is just out of my reach right now guys. gimme another week of soaking it all in.

humbly -c


In reply to using 'require' to insert code by c

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.