Yes, you could put the menu-bar code in a separate file and call it whenever required; you could also read it from a database if you wanted to.

If you're not already familiar with the idea, then you may also find it useful to read a little about Server Side Includes (SSI). I don't know what type of Web server you are using, but I think the principle is common to most servers.

Apologies if I'm telling you something you already know, but, in a nutshell, SSI allows you to put special tags into your html pages, and the server will execute the commands; some may be as simple as printing the date, but (so long as your server is configured for it) you can also execute Perl scripts, or whatever, which might then produce a menu, or footer, etc. It's a very common thing to do.

There are lots of web sites out there with information about Server Side Includes, but I've provided a couple below:

http://www.crucialp.com/resources/tutorials/web-programming/server-side-includes-ssi-tutorial.php

http://httpd.apache.org/docs/current/howto/ssi.html


In reply to Re: calling menu bar creating code from another cgi/pl code by DanielSpaniel
in thread calling menu bar creating code from another cgi/pl code by msinfo

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.