You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Mark D Wolinski <ma...@mrmark.com> on 2000/07/27 21:15:28 UTC

3 Accesses and then nothing...

Hi all..

I'm getting started in Mod_Perl, so I'll assume this is a newbie question.

Here's the problem, with a relatively basic program the system works for 2
or 3 accesses then comes up with "Document Contains No Data" until a
restart.

I'm using httpd -x

So would anyone be kind enough to tell me what the error is and point me to
where it's talked about in either the Eagle book or the Mod_Perl Guide?

Much thanks.

Mark W

=-=-=

Here's the program:

#!/usr/bin/perl -w

use POSIX;
use strict;
use DBI;
use CGI qw(:standard);
use Email::Valid;
use LWP::Simple;
use Mail::Sendmail;
use HTML::FromText;
use IPC::Open3;
use Text::Wrap qw(fill 75);
use CGI::Carp 'fatalsToBrowser';
   $CGI::POST_MAX=1024 * 100;  # max 100K posts
   $CGI::DISABLE_UPLOADS = 1;  # no uploads

require "/usr/local/etc/httpd/sites/xxxxx/xxxxx/routines.lib";

Here's the routines.lib:

##### Setup required variables
my (%IN,%TEMP);
my $query = new CGI;

##### Convert all passed parameters to $IN{}
foreach $temp ($query -> param()) {
  $IN{$temp} = $query -> param($temp);
}
$IN{'act'} = "" unless (defined($IN{'act'})); #### Initialize $IN{act}

print "Content-type: text/html\n\n";
print "Down to the bottom....<br>\n";

while (($key,$value) = each %IN) {
	print "$key - $value<br>\n";
}

1;


RE: 3 Accesses and then nothing...

Posted by Mark D Wolinski <ma...@mrmark.com>.
That sounds like an "Ah Ha!" kind of response.  I'll give it a try.

Mucho Thankos.

Mark W


> -----Original Message-----
> From: Amy Farrell [mailto:afarrell@eMerchandise.com]
> Sent: Thursday, July 27, 2000 7:50 PM
> To: Mark D Wolinski
> Cc: modperl
> Subject: Re: 3 Accesses and then nothing...
>
>
> Mark,
>
> You say:
>
> > > > I'm using httpd -x
>
> If that's not a typo, you should be trying httpd -X  (uppercase X) to
> test the web server in single-process mode. If it is a typo, and you
> have been using -X, I don't know what's happening.
>
> What I would expect you to see in single-process mode, is that it works
> once (not two or three times) and then fails thereafter. I believe your
> required file (routines.lib) is only being loaded, and thus generating
> output, once per process. If, on the other hand, it defined a subroutine
> which you then called in your program, you'd get output every time.
>
>  - Amy
>
>
> Mark D Wolinski wrote:
> >
> > Thanks.
> >
> > I looked at both, I do remember reading over them awhile back,
> but I don't
> > think they apply to my problem.
> >
> > Given the code that I use, should should print at least: "Down to the
> > bottom..." but it doesn't, in fact, it seems like the program
> is erroring
> > out somewhere.  The weird fact is that it's not outputting
> anything to the
> > error log either.
> >
> > So, I'm lost.
> >
> > Mark W
> >
> > > -----Original Message-----
> > > From: ___cliff rayman___ [mailto:cliff@genwax.com]
> > > Sent: Thursday, July 27, 2000 4:49 PM
> > > To: Mark D Wolinski; modperl
> > > Subject: Re: 3 Accesses and then nothing...
> > >
> > >
> > > i think you'll find the answer here:
> > >
> http://perl.apache.org/guide/porting.html#Exposing_Apache_Registry_secret
> > >
> > > and here:
> > > http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S
> > >
> > >
> > > --
> > > ___cliff rayman___cliff@genwax.com___http://www.genwax.com/
> > > Mark D Wolinski wrote:
> > >
> > > > Hi all..
> > > >
> > > > I'm getting started in Mod_Perl, so I'll assume this is a
> > > newbie question.
> > > >
> > > > Here's the problem, with a relatively basic program the system
> > > works for 2
> > > > or 3 accesses then comes up with "Document Contains No Data" until a
> > > > restart.
> > > >
> > > > I'm using httpd -x
> > > >
> > > > So would anyone be kind enough to tell me what the error is and
> > > point me to
> > > > where it's talked about in either the Eagle book or the
> Mod_Perl Guide?
> > > >
> > > > Much thanks.
> > > >
> > > > Mark W
> > > >
> > > > =-=-=
> > > >
> > > > Here's the program:
> > > >
> > > > #!/usr/bin/perl -w
> > > >
> > > > use POSIX;
> > > > use strict;
> > > > use DBI;
> > > > use CGI qw(:standard);
> > > > use Email::Valid;
> > > > use LWP::Simple;
> > > > use Mail::Sendmail;
> > > > use HTML::FromText;
> > > > use IPC::Open3;
> > > > use Text::Wrap qw(fill 75);
> > > > use CGI::Carp 'fatalsToBrowser';
> > > >    $CGI::POST_MAX=1024 * 100;  # max 100K posts
> > > >    $CGI::DISABLE_UPLOADS = 1;  # no uploads
> > > >
> > > > require "/usr/local/etc/httpd/sites/xxxxx/xxxxx/routines.lib";
> > > >
> > > > Here's the routines.lib:
> > > >
> > > > ##### Setup required variables
> > > > my (%IN,%TEMP);
> > > > my $query = new CGI;
> > > >
> > > > ##### Convert all passed parameters to $IN{}
> > > > foreach $temp ($query -> param()) {
> > > >   $IN{$temp} = $query -> param($temp);
> > > > }
> > > > $IN{'act'} = "" unless (defined($IN{'act'})); ####
> Initialize $IN{act}
> > > >
> > > > print "Content-type: text/html\n\n";
> > > > print "Down to the bottom....<br>\n";
> > > >
> > > > while (($key,$value) = each %IN) {
> > > >         print "$key - $value<br>\n";
> > > > }
> > > >
> > > > 1;
> > >
> > >
> > >
> > >
>
> --
> Amy Farrell       | Technical Staff    | afarrell@eMerchandise.com
> 503/944-5044 x224 | eMerchandise.com   | http://www.eMerchandise.com


Re: 3 Accesses and then nothing...

Posted by Amy Farrell <af...@eMerchandise.com>.
Mark, 

You say: 

> > > I'm using httpd -x

If that's not a typo, you should be trying httpd -X  (uppercase X) to
test the web server in single-process mode. If it is a typo, and you
have been using -X, I don't know what's happening. 

What I would expect you to see in single-process mode, is that it works
once (not two or three times) and then fails thereafter. I believe your
required file (routines.lib) is only being loaded, and thus generating
output, once per process. If, on the other hand, it defined a subroutine
which you then called in your program, you'd get output every time. 

 - Amy


Mark D Wolinski wrote:
> 
> Thanks.
> 
> I looked at both, I do remember reading over them awhile back, but I don't
> think they apply to my problem.
> 
> Given the code that I use, should should print at least: "Down to the
> bottom..." but it doesn't, in fact, it seems like the program is erroring
> out somewhere.  The weird fact is that it's not outputting anything to the
> error log either.
> 
> So, I'm lost.
> 
> Mark W
> 
> > -----Original Message-----
> > From: ___cliff rayman___ [mailto:cliff@genwax.com]
> > Sent: Thursday, July 27, 2000 4:49 PM
> > To: Mark D Wolinski; modperl
> > Subject: Re: 3 Accesses and then nothing...
> >
> >
> > i think you'll find the answer here:
> > http://perl.apache.org/guide/porting.html#Exposing_Apache_Registry_secret
> >
> > and here:
> > http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S
> >
> >
> > --
> > ___cliff rayman___cliff@genwax.com___http://www.genwax.com/
> > Mark D Wolinski wrote:
> >
> > > Hi all..
> > >
> > > I'm getting started in Mod_Perl, so I'll assume this is a
> > newbie question.
> > >
> > > Here's the problem, with a relatively basic program the system
> > works for 2
> > > or 3 accesses then comes up with "Document Contains No Data" until a
> > > restart.
> > >
> > > I'm using httpd -x
> > >
> > > So would anyone be kind enough to tell me what the error is and
> > point me to
> > > where it's talked about in either the Eagle book or the Mod_Perl Guide?
> > >
> > > Much thanks.
> > >
> > > Mark W
> > >
> > > =-=-=
> > >
> > > Here's the program:
> > >
> > > #!/usr/bin/perl -w
> > >
> > > use POSIX;
> > > use strict;
> > > use DBI;
> > > use CGI qw(:standard);
> > > use Email::Valid;
> > > use LWP::Simple;
> > > use Mail::Sendmail;
> > > use HTML::FromText;
> > > use IPC::Open3;
> > > use Text::Wrap qw(fill 75);
> > > use CGI::Carp 'fatalsToBrowser';
> > >    $CGI::POST_MAX=1024 * 100;  # max 100K posts
> > >    $CGI::DISABLE_UPLOADS = 1;  # no uploads
> > >
> > > require "/usr/local/etc/httpd/sites/xxxxx/xxxxx/routines.lib";
> > >
> > > Here's the routines.lib:
> > >
> > > ##### Setup required variables
> > > my (%IN,%TEMP);
> > > my $query = new CGI;
> > >
> > > ##### Convert all passed parameters to $IN{}
> > > foreach $temp ($query -> param()) {
> > >   $IN{$temp} = $query -> param($temp);
> > > }
> > > $IN{'act'} = "" unless (defined($IN{'act'})); #### Initialize $IN{act}
> > >
> > > print "Content-type: text/html\n\n";
> > > print "Down to the bottom....<br>\n";
> > >
> > > while (($key,$value) = each %IN) {
> > >         print "$key - $value<br>\n";
> > > }
> > >
> > > 1;
> >
> >
> >
> >

-- 
Amy Farrell       | Technical Staff    | afarrell@eMerchandise.com
503/944-5044 x224 | eMerchandise.com   | http://www.eMerchandise.com

RE: 3 Accesses and then nothing...

Posted by Mark D Wolinski <ma...@mrmark.com>.
Thanks.

I looked at both, I do remember reading over them awhile back, but I don't
think they apply to my problem.

Given the code that I use, should should print at least: "Down to the
bottom..." but it doesn't, in fact, it seems like the program is erroring
out somewhere.  The weird fact is that it's not outputting anything to the
error log either.

So, I'm lost.

Mark W


> -----Original Message-----
> From: ___cliff rayman___ [mailto:cliff@genwax.com]
> Sent: Thursday, July 27, 2000 4:49 PM
> To: Mark D Wolinski; modperl
> Subject: Re: 3 Accesses and then nothing...
>
>
> i think you'll find the answer here:
> http://perl.apache.org/guide/porting.html#Exposing_Apache_Registry_secret
>
> and here:
> http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S
>
>
> --
> ___cliff rayman___cliff@genwax.com___http://www.genwax.com/
> Mark D Wolinski wrote:
>
> > Hi all..
> >
> > I'm getting started in Mod_Perl, so I'll assume this is a
> newbie question.
> >
> > Here's the problem, with a relatively basic program the system
> works for 2
> > or 3 accesses then comes up with "Document Contains No Data" until a
> > restart.
> >
> > I'm using httpd -x
> >
> > So would anyone be kind enough to tell me what the error is and
> point me to
> > where it's talked about in either the Eagle book or the Mod_Perl Guide?
> >
> > Much thanks.
> >
> > Mark W
> >
> > =-=-=
> >
> > Here's the program:
> >
> > #!/usr/bin/perl -w
> >
> > use POSIX;
> > use strict;
> > use DBI;
> > use CGI qw(:standard);
> > use Email::Valid;
> > use LWP::Simple;
> > use Mail::Sendmail;
> > use HTML::FromText;
> > use IPC::Open3;
> > use Text::Wrap qw(fill 75);
> > use CGI::Carp 'fatalsToBrowser';
> >    $CGI::POST_MAX=1024 * 100;  # max 100K posts
> >    $CGI::DISABLE_UPLOADS = 1;  # no uploads
> >
> > require "/usr/local/etc/httpd/sites/xxxxx/xxxxx/routines.lib";
> >
> > Here's the routines.lib:
> >
> > ##### Setup required variables
> > my (%IN,%TEMP);
> > my $query = new CGI;
> >
> > ##### Convert all passed parameters to $IN{}
> > foreach $temp ($query -> param()) {
> >   $IN{$temp} = $query -> param($temp);
> > }
> > $IN{'act'} = "" unless (defined($IN{'act'})); #### Initialize $IN{act}
> >
> > print "Content-type: text/html\n\n";
> > print "Down to the bottom....<br>\n";
> >
> > while (($key,$value) = each %IN) {
> >         print "$key - $value<br>\n";
> > }
> >
> > 1;
>
>
>
>


Re: 3 Accesses and then nothing...

Posted by ___cliff rayman___ <cl...@genwax.com>.
i think you'll find the answer here:
http://perl.apache.org/guide/porting.html#Exposing_Apache_Registry_secret

and here:
http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S


--
___cliff rayman___cliff@genwax.com___http://www.genwax.com/
Mark D Wolinski wrote:

> Hi all..
>
> I'm getting started in Mod_Perl, so I'll assume this is a newbie question.
>
> Here's the problem, with a relatively basic program the system works for 2
> or 3 accesses then comes up with "Document Contains No Data" until a
> restart.
>
> I'm using httpd -x
>
> So would anyone be kind enough to tell me what the error is and point me to
> where it's talked about in either the Eagle book or the Mod_Perl Guide?
>
> Much thanks.
>
> Mark W
>
> =-=-=
>
> Here's the program:
>
> #!/usr/bin/perl -w
>
> use POSIX;
> use strict;
> use DBI;
> use CGI qw(:standard);
> use Email::Valid;
> use LWP::Simple;
> use Mail::Sendmail;
> use HTML::FromText;
> use IPC::Open3;
> use Text::Wrap qw(fill 75);
> use CGI::Carp 'fatalsToBrowser';
>    $CGI::POST_MAX=1024 * 100;  # max 100K posts
>    $CGI::DISABLE_UPLOADS = 1;  # no uploads
>
> require "/usr/local/etc/httpd/sites/xxxxx/xxxxx/routines.lib";
>
> Here's the routines.lib:
>
> ##### Setup required variables
> my (%IN,%TEMP);
> my $query = new CGI;
>
> ##### Convert all passed parameters to $IN{}
> foreach $temp ($query -> param()) {
>   $IN{$temp} = $query -> param($temp);
> }
> $IN{'act'} = "" unless (defined($IN{'act'})); #### Initialize $IN{act}
>
> print "Content-type: text/html\n\n";
> print "Down to the bottom....<br>\n";
>
> while (($key,$value) = each %IN) {
>         print "$key - $value<br>\n";
> }
>
> 1;