in reply to Re: Embedding Perl into HTML
in thread Embedding Perl into HTML

I want to embed perl into the HTML because right now I have the main "index.html" as the blank search page that posts to "search.pl" and all after I do a serch I end up at "http://yourname.com/cgi-bin/search.pl?search=X" where I display all the retrieved info.

So I'm duplicating my HTML twice, once on "index.html" and once inside "search.pl"

I guess there must be a better way to do this. Maybe using a header and footer HTML file that is used in both docs? But I wanted to embed Perl into HTML like PHP is done.

Replies are listed 'Best First'.
Re^3: Embedding Perl into HTML
by bradcathey (Prior) on Apr 24, 2005 at 12:00 UTC

    Look at CGI::Application in combo with HTML::Template to eliminate some of the busy stuff in the URI and allows you to use a simple index.cgi to run the flow. Here's a nice little tutorial.


    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Re^3: Embedding Perl into HTML
by cowboy (Friar) on Apr 24, 2005 at 06:30 UTC
    Mason, or other things allow what you're asking. A simple fix, rather than duplicating the code, see if you can make 'search.pl' your index page. There is nothing magic about index.html, it's just in many cases, the default page shown if someone requests a directory rather than an absolute file. On most hosts you should be able to change it so that the index is whatever file you like.