Re: calling perl program within a cgi script with parameters from html form

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Deepblues <deepblues(at)gmail(dot)com>
Cc: PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>, "'beginners-cgi(at)perl(dot)org' Lists" <beginners-cgi(at)perl(dot)org>
Subject: Re: calling perl program within a cgi script with parameters from html form
Date: 2005-04-26 13:49:28
Message-ID: 3469afce96298d74ebf63c61d8825237@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

This isn't really the right email list for this question. Try this
list instead (to which I have moved the discussion).
beginners-cgi(at)perl(dot)org

However, this likely has to do with privileges to execute your perl
script. In the last couple of days, the beginners-cgi list has
answered your question at least twice. Remember, the webserver
(typically) runs a different user than you, so it may not have the
rights to execute the script. Also, calling a perl program from a perl
CGI script is probably NOT the best way to accomplish the task you are
trying to accomplish. You should probably read up a bit on database
access from CGI scripts and try an example or two.

Sean

On Apr 26, 2005, at 9:25 AM, Deepblues wrote:

> I have a problem linking my cgi script to the perl function.
> I have perl functions to perform manipulations to the database.
> I am creating a web front end to it. I have a html form which accepts
> data from the user and calls the cgi script ( in perl)which processes
> this data , performs validation and passes the form data as parameters
> to a perl program. My cgi script seems to work fine as far as
> processinng goes. My perl program works too. But I am not able to call
> the perl program from the cgi script. I am tryin to test the main perl
> program by having lots of HTML output statements. but it doesn't
> appear on the webpage.
>  
> suppose my form values are stored in variables
> $a = param('name')
> $b = param('age')
>  
> Now I need to call a perl function wth $a, $b as parameters.
> My $string = "perl test.pl $a $b"
> system($string)
>  
> This is wht I am using now. when I try  eg: perl test.pl john 12    It
> works. And the variables are bnided properly in cgi script. I cheked
> to make sure. Can anyone suggest how i should proceed.
>  
> Thanks in advance
> Deepblues
>  

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Frank Bax 2005-04-26 14:03:15 Re: calling perl program within a cgi script with
Previous Message Deepblues 2005-04-26 13:25:11 calling perl program within a cgi script with parameters from html form