in reply to Includes in Perl

Not a direct answer, but when using Apache, I normally use Server Side Includes (SSI) for this sort of thing. The main files are commonly named with a shtml suffix (configurable) and can include tags like
<!--#include virtual="/common/header.inc-->
to bring in reusable elements.

Someone else will certainly post Perl-specific solutions but you might see if this simple approach would be permitted.

Update: fixed botched link

Replies are listed 'Best First'.
Re^2: Includes in Perl
by Rachy222 (Novice) on Dec 09, 2007 at 20:55 UTC
    I tried that I get the following error an error occurred while processing this directive. As I said I am a total code novice so I could be doing something totally obviously wrong so if you can spot something: Have a folder called includes, in this folder is a .inc file called test which contains one line of text for the time being. I slotted the line you gave me into my .shtml file where I want the text to appear. Then uploaded them all onto my web space. Any ideas? Cheers Rachy
      Ok it appears that I don't have SSI on the server so that would be why the script doesn't work. Thanks for your help though. Cheers Rachy
        Actually, I'd say it does look like you have SSI support. Without SSI, the command would've simply been read as a comment and silently ignored.

        Without any details on the error you saw, I'd guess that it's complaining about not being able to find "/common/head.inc", right? What I wrote was just an example (I could have been more clear) but the real point is that you should probably next go to one of the references you've received here and try some real SSI directives (including files that actually exist).