How to tie Perl script with cgi

V

Vinay Nagrik

Hello group,

I am just introduced to Perl and written my first program. I need to
fire it through a cgi script.

Could someone tell me how to tie two programs together so that when I
send a post request through uri, my script gets fired.

Thanks in advance.

nagrik
 
T

Tad McClellan

Vinay Nagrik said:
Subject: How to tie Perl script with cgi


[ "tie" has a special meaning in Perl and it is not the meaning
that I think you had in mind. See:

perldoc -f tie

perldoc perltie
]

I am just introduced to Perl and written my first program. I need to
fire it through a cgi script.

Could someone tell me how to tie two programs together so that when I
send a post request through uri, my script gets fired.


I think you are asking how to run an external program from within Perl.

The fact that the external program is written in Perl is not relevant.

The fact that the calling program is running in a CGI environment is
also not relevant.


You run external programs from within Perl using one of:

perldoc -f system

perldoc -f qx

perldoc -f open


See also:

perldoc -q STDERR

How can I capture STDERR from an external command?

There are three basic ways of running external commands:

...
 
X

xhoster

Vinay Nagrik said:
Hello group,

I am just introduced to Perl and written my first program. I need to
fire it through a cgi script.

This is mainly depended on the caller, not the callee. So you should
figure how to call external programs in whatever language your cgi script
is written in.
Could someone tell me how to tie two programs together so that when I
send a post request through uri, my script gets fired.

If your cgi script is *also* written in perl, then you should probably
turn your existing non-cgi script into a module (perldoc perlmod) and then
incorporate it into the cgi-script that way, rather than starting up
yet another perl run-time.

Xho
 
M

Mumia W.

Hello group,

I am just introduced to Perl and written my first program. I need to
fire it through a cgi script.

Could someone tell me how to tie two programs together so that when I
send a post request through uri, my script gets fired.

Thanks in advance.

nagrik

http://www.w3.org/TR/html4/interact/forms.html#adef-action

Either an HTML page or a CGI script will present a form to the
user, and that form's action attribute will point to your
form-processing CGI script.

It's a good idea to know HTML before trying to write CGI scripts.
 
J

Joe Smith

Vinay said:
I am just introduced to Perl and written my first program. I need to
fire it through a cgi script.
Could someone tell me how to tie two programs together so that when I
send a post request through uri, my script gets fired.

1) Install perl on your computer.
2) Install a web server on your computer.
3) Configure the web server to allow CGI execution.
4) Put your CGI script where the web server will see it.
5) Write some HTML that has form that does a POST to your script.
6) Hit the form with your browser.

As you can see, none of those steps are on-topic for this newsgroup.
That's why you were told to "Ask in some webserver configuration group."

-Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top