Contributed by Anonymous Monk
on Nov 21, 2000 at 21:48 UTC
Q&A
> HTTP and FTP clients
Description: It has to be a very simple process. I've just started using Perl in school and need to know how to run a Perl script on a web page.
Answer: How do you embed a Perl script into an HTML document? contributed by KM Look into HTML::Mason at http://www.masonhq.com. | Answer: How do you embed a Perl script into an HTML document? contributed by a As w/ the 'down off an elephant' joke' you don't,
generally. You write perl cgi to produce the web
page. But there's more. Mason et alia are
ways to do that (there's a perlscript/IIS implant)
one of which is covered in the July (alas *not*
online)
2000 issue of SysAdmin, which uses perl (and sh/ksh)
'here' documents, apache and the htttpd.conf file
to do on-the-fly perl processing. Pretty nice.
For more on Mason and other options, see
perlmonth
- a great resource, though it seems to have been'
halted at issue 11. ;-<
a | Answer: How do you embed a Perl script into an HTML document? contributed by nite_man You can embed Perl into HTML page using Embperl. Look through review of this module by trs80. | Answer: How do you embed a Perl script into an HTML document? contributed by damian1301 Well just to start, I got most of this info from "Perl in a Nutshell". First, you have to make sure that it can support ASP. Then to place it in the HTML document use the <script></script> tags Ex:
<Script language="PerlScript">
$window->document->write("This is PerlScript..");
</script>
| Answer: How do you embed a Perl script into an HTML document? contributed by Malkavian From your question, I'd assume you're talking about using CGI.
For this, check out CGI.pm from CPAN as a programming module. It's very useful.
If you're not familiar with the process of CGI programming, I'd suggest reading a small book about it, or doing a few searches here.. I'm sure there are a few tutorials on it.
The basis of CGI is that you have a Perl script on the web server, which is invoked when a browser points to it. The output of the Perl program is the html of the page. Inputs are achieved via forms.
Well, that's very simplistic, but you'll get the idea searching round.
Hope this helps some,
Malk | Answer: How do you embed a Perl script into an HTML document? contributed by snapdragon Considering that you beginning it's probably well worth having a look at Server SIde includes (SSI). SSI's allow HTML files to be written and then have perl scripts embedded in them. Have a look at this quick SSI Tutorial and see what you think. | Answer: How do you embed a Perl script into an HTML document? contributed by Anonymous Monk i have found that using frames is the best way around it, but if you insist on not using frames, then you could place a hidden html tag eg.
at the point where you want your returned code to appear, create a cript that opens your html file (as a template) and reads it into an array, do a foreach loop through the array and if is found on the line, run the required routine then finnish your foreach loop... I hope that makes sense |
Please (register and) log in if you wish to add an answer
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|