Note that there are some explanatory texts on larger screens.

plurals
  1. POrunning a perl cgi script from a webpage (html)
    primarykey
    data
    text
    <p>I have been searching for a tutorial on how to run a perl program from an html webpage. I cannot find a tutorial or even a good starting point that explains clearly how to do this... </p> <p>What I'm trying to do is use WWW::mechanize in perl to fill in some information for me on the back end of a wordpress site. Before I can do that I'd like to just see the retrieved html displayed in the browser like the actual website would be displayed in the browser. Here is my perl:</p> <pre><code>print "Content-type: text/html\n\n"; use CGI; use WWW::Mechanize; my $m = WWW::Mechanize-&gt;new(); use WWW::Mechanize; $url = 'http://www.storagecolumbusohio.com/wp-admin'; $m-&gt;post($url); $m-&gt;form_id('loginform'); $m-&gt;set_fields('log' =&gt; 'username', 'pwd' =&gt; 'password'); $page = $m-&gt;submit(); $m-&gt;add_handler("request_send", sub { shift-&gt;dump; return }); $m-&gt;add_handler("response_done", sub { shift-&gt;dump; return }); print $page-&gt;decoded_content; </code></pre> <p>This code works from the command prompt (actually I'm on mac, so terminal). However I'd like it to work from a website when the user clicks on a link.</p> <p>I have learned a few things but it's confusing for me since I'm a perl noob. It seems that there are two ways to go about doing this (and I could be wrong but this is what I've gathered from what iv'e read). One way people keep talking about is using some kind of "template method" such as embperl or modperl. The other is to run the perl program as a cgi script. From what I've read on various sites, it seems like cgi is the simplest and most common solution? In order to do that I'm told I need to change a few lines in the httpd.conf file. Where can I find that file to alter it? I know I'm on an apache server, but my site is hosted by dreamhost. Can I still access this file and if so how?</p> <p>Any help would be greatly appreciated as you can probably tell I don't have a clue and am very confused.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload