in reply to php style includes

How about HTML::Template?

-thabenksta
my $name = 'Ben Kittrell'; $name=~s/^(.+)\s(.).+$/\L$1$2/g; my $nick = 'tha' . $name . 'sta';

Replies are listed 'Best First'.
Re: Re: php style includes
by andreychek (Parson) on Jul 02, 2001 at 23:50 UTC
       How about HTML::Template
    Agreed. If you use HTML::Template, you can use include statements within your HTML documents. Something like this could go in your index.html (or where ever):
    <html> <body> <tmpl_include="templates/top.html"> <tmpl_include="templates/left.html"> <tmpl_include="templates/main.html"> <tmpl_include="templates/bottom.html"> </body> </html> In your Perl code, you would just say: <code> use HTML::Template(); # open the html template my $template = HTML::Template->new(filename => 'index.html'); # Fill in various parameters here ... # Send header here ... # print the template print $template->output;
    The documentation for this module is very good, just read up on it for instructions on what all you can do with it.
    -Eric
Re: Re: php style includes
by BigVic (Initiate) on Jul 03, 2001 at 00:21 UTC
    HTML::Template IS NOT AVAILABLE.
      if you have the ability to create a .pl file and directories on the server then you can use really any module.

      I never bother my hosting provider with module installs, instead I have a perl-lib dir in my home directory with around 5 megs of modules. You just need to add the path to your perl files. I use something like this:

      use lib ("/home/myusername/perl-lib");
      @INC stuff
      Use Lib() and require
      perlman:lib:lib

      If you're absolutely intent on not using any modules, try implementing you own handler:

      for (@page) { s/include\("([^"]+)"\)//;print; if(open F $1){while(<F>){print}} }
      this one should work with php style tags (what you showed). it's incredibly insecure and would miss alot, and may not even work, but it demonstrates the idea