Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Answer: trying to run a perl program in HTML

by tinman (Curate)
on Apr 23, 2001 at 00:13 UTC ( #74591=categorized answer: print w/replies, xml ) Need Help??

Q&A > HTTP and FTP clients > trying to run a perl program in HTML - Answer contributed by tinman

You need to install a webserver on your computer.. use IIS, PWS, or even Apache for Win32..

Next, write a HTML form as so..

<form action="launcher.pl" method="post"> <input type="submit" name="sub" value="Run this!"> </form>
on your page..

Inside your launcher.pl CGI script (yes, you've writen a CGI script now), execute the Perl script that you want using exec or system or backticks like so..

#!c:/perl/bin -w use strict; use CGI; my $q = new CGI; my $path_to_program = "c:/perl/myprog/prog.pl"; my $return_value = system("c:/perl/bin/perl.exe",$path_to_program); # this is the actual execution of the script. # now you can put a message to the user print $q->header; # send correct header, text/html # put HTML here

It might be best if you restrict access to this script to ONLY your machine..
HTH

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2020-07-09 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?