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

Embedding Perl in HTML

by Nalina (Monk)
on Jul 13, 2005 at 11:27 UTC ( [id://474499]=perlquestion: print w/replies, xml ) Need Help??

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

hi monks, is it possible to embed perl in html? If possible how can it be done? my system configuration is
OS: windows 2000 Professional
Web server: IIS
PERL: Active perl 5.8.3
Do I need to install any extra tool/software for this? kindly help
Thanks in Advance

Replies are listed 'Best First'.
Re: Embedding Perl in HTML
by tphyahoo (Vicar) on Jul 13, 2005 at 11:35 UTC
    Yes. There are a bunch of different ways to do this. In fact, one of the problems I had when in your situation, was deciding which competing technology to use.

    I would start by downloading apachefriends with modperl, and just study their basic install a bit to get a feel for how things work:

    "Many people know from their own experience that it's not easy to install an Apache web server and it gets harder if you want to add MySQL, PHP and Perl. XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start." (From the aachefriends web site)

    You might then want to have a look at Survey of Surveys on HTML Templating systems, to see a comparison of all the various ways to get this done.

    Personally, I favor mason, which comes with a nicely built sample application that includes db connectivitiy, if I recall correctly. Get that installed over your apachefriends install, and you are off to the races.

    Good luck.

      Thanks for the reply. but i don't have apache, i have IIS installed on windows 2000 professional. Is it manditory to install apache to embed perl in HTML? Can't it be done with IIS?
        See my comment below. There probably is a way to get this to work, but I think it would be easier if you move to apache: especially because there are more people willing to help you on forums and that sort of thing.

        The most "plug and play" solutions I know with web-perl for beginners usually involve apache, and this includes on windows (which is my setup). Apachefriends is pretty easy to setup.

        If there is an "easy" way to get perl to play nicely with IIS I would be interested in learning about this as well.

        Update: perl on iis is definitely doable, but I stand by my judgement that ultimately this will be easier if you switch to apache.

Re: Embedding Perl in HTML
by wazoox (Prior) on Jul 13, 2005 at 11:43 UTC
    In case you actually want to embed Perl in HTML the php way, there's plp. It works very well, and there's a PPM package for it too.
Re: Embedding Perl in HTML
by gellyfish (Monsignor) on Jul 13, 2005 at 11:48 UTC

    With the setup you have you can also use 'Perlscript' instead of VBScript in ASP, it works reasonably well but it sucks in the same way all those things that encourage you to mix up the code and the HTML do (yes PHP I'm looking at you as well.)

    /J\

Re: Embedding Perl in HTML
by davidrw (Prior) on Jul 13, 2005 at 13:11 UTC
    Why do you need to embed perl in html? Can your solution be re-thought to fully/properly separate logic and content? My personal favorte is Template::Toolkit, which can embed perl but it's primary use is as a very powerful template engine.

    Can you post a specific example of a perl snippet you are thinking that you need to embed?
Re: Embedding Perl in HTML
by chas (Priest) on Jul 13, 2005 at 11:47 UTC
    Check out the various Embperl modules on CPAN. e.g. look at this.
    chas
Re: Embedding Perl in HTML
by perrin (Chancellor) on Jul 13, 2005 at 15:01 UTC
    I needed to do this on IIS a few years ago. You can use PerlScript, and it will work fine, but it's kind of slow. If performance is an issue, ActiveState's PerlASPX is probably your simplest option. I think it comes with your ActiveState install.
Re: Embedding Perl in HTML
by tphyahoo (Vicar) on Jul 13, 2005 at 11:57 UTC
    Re my and the other above posts: I think the other posts were more onspot with regards to the "embedding" the OP wanted.

    However, I notice the OP asks if any of this is workable with IIS, and I have this to say. IIS is a pain in the butt for everything other than ASP. So, recommend you look into apachefriends as I suggested above. Cheers!

    Update: although see my hedge above about perl on iis being doable.

Log In?
Username:
Password:

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

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

    No recent polls found