You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Gary Nielson <gn...@charlotte.infi.net> on 2001/05/31 21:56:21 UTC

BINGO! (was Re: Problem getting a cgi program to run)

Running it from the command line, I did the following and it works:

[- 
sub newsedit
{
        my ($self, $department) = @_;
        chdir("/webServer/virtualDW/cannonschool.org/cgi-bin/newsEdit2/");
        $ENV{QUERY_STRING} = "name=$department";
        open FH, ("/usr/bin/perl /webServer/virtualDW/cannonschool.org/cgi-bin/newsEdit2/department.cgi|")
                        or die "Cannot start cgi";
        while (<FH>) {
                if ($_ =~ m/Content\-Type\: text\/html/i) { print OUT ""; } else {
                print OUT $_;   }
        }
        close (FH);

}
-]

Basically, I deleted the line that included the path to the newsedit
program in the perl libraries path and changed it to simply changing to
that directory, and it works splendidly. 

Thanks, Gerald and Wim, for all your help on this. I have learned
alot. Thanks for your patience.

Gary

On Thu, 31 May 2001, Gerald Richter wrote:

> > Hi, I tried that and called it with:
> >
> > [-    $subs->newsedit();
> > -]
> >
> > on an html page, but nothing is displayed.
> >
> 
> Does the command from your page
> 
> /usr/bin/perl
> /webServer/virtualDW/cannonschool.org/cgi-bin/newsEdit2/department.cgi
> 
> work from the command line ? If not, what do you have to do to make it
> working ?
> 
> Gerald
> 
> 
> -------------------------------------------------------------
> Gerald Richter    ecos electronic communication services gmbh
> Internetconnect * Webserver/-design/-datenbanken * Consulting
> 
> Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
> E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
> WWW:        http://www.ecos.de      Fax:      +49 6133 925152
> -------------------------------------------------------------
> 
> 
> 

-- 
Gary Nielson
gary@garynielson.com





---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org