You can use Mason via CGI, although that would require you getting the modules installed, some of which, may need compiling.
You might look at Text::MicroMason.
It sounds to me though, like you mainly want to use a template for the tables, in that case, there are many templating solutions you could use. Some like Template::Toolkit, others like HTML::Template, others prefer Mason, or Embperl. There are lots of options you can just stick into your script to display the data nicely.
| [reply] |
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.
| [reply] |
| [reply] [d/l] |
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.
| [reply] |
Pardon me for replying with a question, but why are Perl SSI's not an option? The main complication for most shared hosts is having to use a .shtml file name.
| [reply] |
Consider CGI::FastTemplate. If your hosting provider doesn't have it installed, you can just drop it somewhere accessible in your account's space and use lib('path/to') to get at it. | [reply] |
s/\{(.*)\}/$1/eg;
(Obviously this is a pretty silly answer. But the question is fairly silly also =] ) | [reply] [d/l] |