Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8378681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:58:59+00:00 2026-06-09T15:58:59+00:00

I have been searching for a tutorial on how to run a perl program

  • 0

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…

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:

print "Content-type: text/html\n\n";
use CGI;
use WWW::Mechanize;
my $m = WWW::Mechanize->new();



use WWW::Mechanize;
$url = 'http://www.storagecolumbusohio.com/wp-admin';
$m->post($url);
$m->form_id('loginform');
$m->set_fields('log' => 'username', 'pwd' => 'password');
$page = $m->submit();
$m->add_handler("request_send",  sub { shift->dump; return });
$m->add_handler("response_done", sub { shift->dump; return });
print $page->decoded_content;

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.

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?

Any help would be greatly appreciated as you can probably tell I don’t have a clue and am very confused.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:59:00+00:00Added an answer on June 9, 2026 at 3:59 pm

    To use a cgi script on dreamhost, it is sufficient to

    1. give the script a .cgi extension
    2. put the script somewhere visible to the webserver
    3. give the script the right permissions (at least 0755)

    You may want to see if you can get a toy script, say,

    #!/usr/bin/perl
    print "Content-type: text/plain\n\nHello world\n";
    

    working before you tackle debugging your larger script.

    That said, something I don’t see in your script is the header. I think you’ll want to say something like

    print "Content-type: text/html\n\n";
    

    before your other print call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been searching for a command that will return files from the current
I have been searching for a few hours and cant seem to find answer
I have been searching and haven't got luck, I got a tutorial to use
I've have been desperately searching for a tutorial on how to use the mount()
I have been searching online for awhile, trying to find the best way to
I need some help, i have been searching around and cant find the correct
I have been searching around the web for a couple of days to find
I have been searching all over but I can't find any answer to this.
So far i have been searching on google and haven't fount a single good
i'm new to php , i have been searching for a tutorial regarding inserting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.