Thank you! I had not realized you had sent a previous email as well. I
tried this solution and so far, it has not worked -- and I have some
questions about that. But I did find another solution that does work, and
I wanted to share that and see if there is any disadvantage to this
approach, if there might be more performance degradation this way or not.
First, the problems I encountered with the first approach.
I realized that the newsedit, encrypted perl application relies on
a variable passed to the apache Web server before initiating
the cgi script (see below). When I invoked:
[-
sub newsedit
{
my ($self, $department) = @_;
unshift(@INC,
'/webServer/virtualDW/cannonschool.org/cgi-bin/newsEdit2') ;
open FH, ("/usr/bin/perl
/webServer/virtualDW/cannonschool.org/cgi-bin/newsEdit2/department.cgi?name=Homepage|")
or
die "Cannot start cgi";
@output = <FH> ;
close FH ;
print OUT @output ;
}
-]
it did not work and I suspected that was why. I do not know for sure. Does
this make sense?
When invoked through exec cgi, it passes the following to the apache web
server:
<!--#set var="name" value="Homepage" -->
<!--#exec cgi="/cgi-bin/newsEdit2/department.cgi" -->
But then I thought of another way. I do not know if this is a good
solution or not, but it does work:
[-
sub writepage
{
use LWP::Simple;
my ($self, $department) = @_;
$graburl="http://www.cannonschool.org/cgi-bin/newsEdit2/department.cgi?name=$department";
print OUT (get $graburl);
}
-]
I invoke it in an html file as:
[- $subs = $param[0];
$subs->writepage ("Homepage");
-]
and it comes up. Now I am wondering if by having to make a DNS request to
the domain, if I am creating more work and therefore slowing down
execution more than if I could actually get the first solution to work
right. Or if invoking another instance of perl, in either case, amounts to
about the same amount of work. What do you think, and if you think the
first approach is the better way, what am I still doing wrong?
Thanks for all your help.
Gary
On Thu, 31 May 2001, G.Richter wrote:
> > Please forgive my newbie questions here. I set the following in
> > httpd.conf:
> >
> > # EMBPERL STUFF
> > SetEnv EMBPERL_ESCMODE 0
> > SetEnv EMBPERL_OPTIONS 16,16384
> >
>
> You have to add these two numbers together:
>
> SetEnv EMBPERL_OPTIONS 16700
>
>
> > and then in the html file, I did the following:
> >
> > [- BEGIN { unshift(@INC,
> > '/webServer/virtualDW/cannonschool.org/cgi-bin/newsEdit2/') } -]
> > [- $name = "Homepage" -]
> > [- require
> >
> ('/webServer/virtualDW/cannonschool.org/cgi-bin/newsEdit2/department.cgi') -
> ]
> >
>
> require will execute your script only once
>
> > I felt I needed to add the newsedit path to @INC because I was getting
> > error messages before that embperl could not find modules that were
> > required by department.cgi.
> >
>
> That's ok
>
> > I have gotten past those error messages now, but I see in the errors that
> > "
> > [9066]ERR: 24: Line 25: Error in Perl code: No such file or directory at
> > /webServer/virtualDW/cannonschool.org/cgi-bin/newsEdit2//Relationship.pm
> > line 2."
> >
> > The perl application newsEdit works fine outside of embperl so something
> > must still be wrong with the way I am setting up paths or something. It is
> > hard for me to tell what is on line2 of Relationship.pm because of the
> > encryption it appears the entire program runs on line 2 in vi.
> > Either that or for some reason there are 2 '/' in that error
> > message: cgi-bin/newsEdit2//Relationship.pm
> > line 2. I see nothing in newsedit's config file to explain this.
> >
>
> line 2 will be the line where the decrytion filter lives, so as seen from
> point of the Perl interpreter everythings comes from line 2
>
> I wrote two mails with the same subject, but different content. Did you see
> my first mail where I suggested to run a separate Perl interpreter and catch
> the output ? I think this will solve your problems
>
> Gerald
>
>
--
Gary Nielson
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]