Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

perl code in html files...

by noname00 (Novice)
on May 12, 2004 at 23:18 UTC ( [id://352924]=perlquestion: print w/replies, xml ) Need Help??

noname00 has asked for the wisdom of the Perl Monks concerning the following question:

hi everyone, i have a site.. i do not want to make it all dynamic... but there some places in the html file that i would like to be dynamic... for exapmle, in the bottom of the page in a table i would like to print some dynamic content.. how can i do this, by calling a perl script? thanx in advance

Replies are listed 'Best First'.
Re: perl code in html files...
by davido (Cardinal) on May 12, 2004 at 23:27 UTC
    ActiveState Perl supports PerlScript which can be made to work with Internet Explorer, but you'll limit your audience to about two people in the universe; nobody has their browers set up with PerlScript extensions.

    If you want an HTML document to render with dynamic content that is interpreted client-side (in the browser), a better bet is to use Javascript.

    Perl can be used to output dynamic content, but does so using the Common Gateway Interface (CGI). This is a server-side system. The server executes the script, and the script dynamically outputs HTML, to be rendered by the browser. The most common way of handling CGI with Perl is by using the CGI module.

    You can use a templating system to make it a little easier to add a dynamic element to static documents. HTML::Template is a good starting point for that approach.


    Dave

Re: perl code in html files...
by matthewb (Curate) on May 13, 2004 at 10:58 UTC
    i have a site.. i do not want to make it all dynamic... but there some places in the html file that i would like to be dynamic...

    Although you are inspecific, the traditional and, I suspect, most simple solution would be to use Server Side Includes to integrate elements of dynamic content into an otherwise static HTML page. The majority of the examples you will find of using this technique (beyond the super-simple) will, no doubt, use Perl to generate content.

    Having said that, you will receive as many recommendations as you care to solicit for web content generation techniques; I think most people work out what best serves their needs through trial and error. For more demanding projects, we've been using the Template Toolkit for a couple of years now with great results.

    MB
Re: perl code in html files...
by Wampa (Hermit) on May 13, 2004 at 05:51 UTC

    Try use Embperl. It is Perl embeded in html and ideal for your site. Embperl specification

    Programing in Embperl and all questions are related to Embperl.
    Excuse my bad English !!!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://352924]
Approved by bart
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-23 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found