Re: Apache::OK error

2002-04-25 Thread Stas Bekman

Per Einar Ellefsen wrote:

> Yes, Stas,  but I think this example was taken from the docs:
> 
>http://perl.apache.org/preview/modperl-docs/dst_html/docs/2.0/user/overview/overview.html#Apache__Echo
> 
> 
> These examples need to be synced with the CVS versions then.

done, thanks

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: Apache::OK error

2002-04-25 Thread Per Einar Ellefsen

At 04:11 26.04.2002, Stas Bekman wrote:
>Per Einar Ellefsen wrote:
>>At 22:04 25.04.2002, Per Einar Ellefsen wrote:
>>
>>>At 21:39 25.04.2002, Lihn, Steve wrote:
>>>
Hi,
I am testing the Apache::Echo connection handler for Apache2 and 
mod_perl 2.
But encounter the following error:

[Thu Apr 25 15:32:15 2002] [error] failed to resolve handler `Apache::Echo'
[Thu Apr 25 15:32:15 2002] [error] Bareword "Apache::OK" not allowed while
"strict subs" in use at C:\Apache2/blib/lib/Apache2/Apache/Echo.pm line 25.
Compilation failed in require at (eval 2) line 3.

What do I miss?
>>>
>>>
>>>Try adding
>>>use Apache::Const qw/:common/;
>>>at the top
>>>
>>>and replace return Apache::OK with
>>>return OK;
>>>
>>>Seems like the docs say Apache::OK everywhere, but I don't know if this 
>>>is supposed to work or not.
>>
>>Or actually, looking at the files in t/, it's probably better to do:
>>use Apache::Const -compile => 'OK';
>>And leave the Apache::OK line as is.
>
>I've adjusted all the tests in t/ a few weeks ago, e.g.:
>http://cvs.apache.org/viewcvs.cgi/modperl-2.0/t/protocol/TestProtocol/echo.pm?rev=1.2&content-type=text/vnd.viewcvs-markup
>
>while 1.99 beta was released your best bet is to always use cvs version of 
>httpd and mod_perl before it's released for real. So you can benefit from 
>all the fixes reported since the release and new developments.

Yes, Stas,  but I think this example was taken from the docs:
http://perl.apache.org/preview/modperl-docs/dst_html/docs/2.0/user/overview/overview.html#Apache__Echo
These examples need to be synced with the CVS versions then.


-- 
Per Einar Ellefsen
[EMAIL PROTECTED]





Re: Apache::OK error

2002-04-25 Thread Stas Bekman

Per Einar Ellefsen wrote:
> At 22:04 25.04.2002, Per Einar Ellefsen wrote:
> 
>> At 21:39 25.04.2002, Lihn, Steve wrote:
>>
>>> Hi,
>>> I am testing the Apache::Echo connection handler for Apache2 and 
>>> mod_perl 2.
>>> But encounter the following error:
>>>
>>> [Thu Apr 25 15:32:15 2002] [error] failed to resolve handler 
>>> `Apache::Echo'
>>> [Thu Apr 25 15:32:15 2002] [error] Bareword "Apache::OK" not allowed 
>>> while
>>> "strict subs" in use at C:\Apache2/blib/lib/Apache2/Apache/Echo.pm 
>>> line 25.
>>> Compilation failed in require at (eval 2) line 3.
>>>
>>> What do I miss?
>>
>>
>> Try adding
>> use Apache::Const qw/:common/;
>> at the top
>>
>> and replace return Apache::OK with
>> return OK;
>>
>> Seems like the docs say Apache::OK everywhere, but I don't know if 
>> this is supposed to work or not.
> 
> 
> Or actually, looking at the files in t/, it's probably better to do:
> use Apache::Const -compile => 'OK';
> 
> And leave the Apache::OK line as is.

I've adjusted all the tests in t/ a few weeks ago, e.g.:
http://cvs.apache.org/viewcvs.cgi/modperl-2.0/t/protocol/TestProtocol/echo.pm?rev=1.2&content-type=text/vnd.viewcvs-markup

while 1.99 beta was released your best bet is to always use cvs version 
of httpd and mod_perl before it's released for real. So you can benefit 
from all the fixes reported since the release and new developments.


__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: Apache::OK error

2002-04-25 Thread Per Einar Ellefsen

At 22:04 25.04.2002, Per Einar Ellefsen wrote:
>At 21:39 25.04.2002, Lihn, Steve wrote:
>>Hi,
>>I am testing the Apache::Echo connection handler for Apache2 and mod_perl 2.
>>But encounter the following error:
>>
>>[Thu Apr 25 15:32:15 2002] [error] failed to resolve handler `Apache::Echo'
>>[Thu Apr 25 15:32:15 2002] [error] Bareword "Apache::OK" not allowed while
>>"strict subs" in use at C:\Apache2/blib/lib/Apache2/Apache/Echo.pm line 25.
>>Compilation failed in require at (eval 2) line 3.
>>
>>What do I miss?
>
>Try adding
>use Apache::Const qw/:common/;
>at the top
>
>and replace return Apache::OK with
>return OK;
>
>Seems like the docs say Apache::OK everywhere, but I don't know if this is 
>supposed to work or not.

Or actually, looking at the files in t/, it's probably better to do:
use Apache::Const -compile => 'OK';

And leave the Apache::OK line as is.


-- 
Per Einar Ellefsen
[EMAIL PROTECTED]





Re: Apache::OK error

2002-04-25 Thread Per Einar Ellefsen

At 22:00 25.04.2002, Perrin Harkins wrote:
>Oops, that's right, it's in the Apache::Constants package.  Changing your 
>code to say Apache::Constants::OK should do it.  No need to import all of 
>that stuff unless you want to.

This is mod_perl 2, so Apache::Constants has been replaced by Apache::Const 
(AFAIK).

>Jon Robison wrote:
>>maybe a "use Apache::Constants qw/ :common /;"  
>>--Jon Robison
>>"Lihn, Steve" wrote:
>>
>>>Hi,
>>>I am testing the Apache::Echo connection handler for Apache2 and mod_perl 2.
>>>But encounter the following error:
>>>
>>>[Thu Apr 25 15:32:15 2002] [error] failed to resolve handler `Apache::Echo'
>>>[Thu Apr 25 15:32:15 2002] [error] Bareword "Apache::OK" not allowed while
>>>"strict subs" in use at C:\Apache2/blib/lib/Apache2/Apache/Echo.pm line 25.
>>>Compilation failed in require at (eval 2) line 3.
>>>
>>>What do I miss?
>>
>>--
>>Per Einar Ellefsen
>>[EMAIL PROTECTED]





Re: Apache::OK error

2002-04-25 Thread Per Einar Ellefsen

At 21:39 25.04.2002, Lihn, Steve wrote:
>Hi,
>I am testing the Apache::Echo connection handler for Apache2 and mod_perl 2.
>But encounter the following error:
>
>[Thu Apr 25 15:32:15 2002] [error] failed to resolve handler `Apache::Echo'
>[Thu Apr 25 15:32:15 2002] [error] Bareword "Apache::OK" not allowed while
>"strict subs" in use at C:\Apache2/blib/lib/Apache2/Apache/Echo.pm line 25.
>Compilation failed in require at (eval 2) line 3.
>
>What do I miss?

Try adding
use Apache::Const qw/:common/;
at the top

and replace return Apache::OK with
return OK;

Seems like the docs say Apache::OK everywhere, but I don't know if this is 
supposed to work or not.


-- 
Per Einar Ellefsen
[EMAIL PROTECTED]





Re: Apache::OK error

2002-04-25 Thread Perrin Harkins

Oops, that's right, it's in the Apache::Constants package.  Changing 
your code to say Apache::Constants::OK should do it.  No need to import 
all of that stuff unless you want to.

Jon Robison wrote:
> maybe a "use Apache::Constants qw/ :common /;"  
> 
> --Jon Robison
> 
> "Lihn, Steve" wrote:
> 
>>Hi,
>>I am testing the Apache::Echo connection handler for Apache2 and mod_perl 2.
>>But encounter the following error:
>>
>>[Thu Apr 25 15:32:15 2002] [error] failed to resolve handler `Apache::Echo'
>>[Thu Apr 25 15:32:15 2002] [error] Bareword "Apache::OK" not allowed while
>>"strict subs" in use at C:\Apache2/blib/lib/Apache2/Apache/Echo.pm line 25.
>>Compilation failed in require at (eval 2) line 3.
>>
>>What do I miss?
>>
>>--Steve
>>
>>--
>>package Apache::Echo;
>>
>> use strict;
>> use Apache::Connection ();
>> use APR::Socket ();
>>
>> use constant BUFF_LEN => 1024;
>>
>> sub handler {
>> my Apache::Connection $c = shift;
>> my APR::Socket $socket = $c->client_socket;
>>
>> my $buff;
>>
>> for (;;) {
>> my($rlen, $wlen);
>> my $rlen = BUFF_LEN;
>> $socket->recv($buff, $rlen);
>> last if $rlen <= 0;
>> $wlen = $rlen;
>> $socket->send($buff, $wlen);
>> last if $wlen != $rlen;
>> }
>>
>> return Apache::OK;
>> }
>>
>> 1;
>> __END__
>>
>>  Steve Lihn
>>  FIS Database Support, Merck & Co., Inc.
>>  Tel: (908) 423 - 4441
>>
>>--
>>Notice:  This e-mail message, together with any attachments, contains information of 
>Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, 
>proprietary copyrighted and/or legally privileged, and is intended solely for the use 
>of the individual or entity named in this message.  If you are not the intended 
>recipient, and have received this message in error, please immediately return this by 
>e-mail and then delete it.
>>
>>==
> 
> 






Re: Apache::OK error

2002-04-25 Thread Jon Robison


maybe a "use Apache::Constants qw/ :common /;"  

--Jon Robison

"Lihn, Steve" wrote:
> 
> Hi,
> I am testing the Apache::Echo connection handler for Apache2 and mod_perl 2.
> But encounter the following error:
> 
> [Thu Apr 25 15:32:15 2002] [error] failed to resolve handler `Apache::Echo'
> [Thu Apr 25 15:32:15 2002] [error] Bareword "Apache::OK" not allowed while
> "strict subs" in use at C:\Apache2/blib/lib/Apache2/Apache/Echo.pm line 25.
> Compilation failed in require at (eval 2) line 3.
> 
> What do I miss?
> 
> --Steve
> 
> --
> package Apache::Echo;
> 
>  use strict;
>  use Apache::Connection ();
>  use APR::Socket ();
> 
>  use constant BUFF_LEN => 1024;
> 
>  sub handler {
>  my Apache::Connection $c = shift;
>  my APR::Socket $socket = $c->client_socket;
> 
>  my $buff;
> 
>  for (;;) {
>  my($rlen, $wlen);
>  my $rlen = BUFF_LEN;
>  $socket->recv($buff, $rlen);
>  last if $rlen <= 0;
>  $wlen = $rlen;
>  $socket->send($buff, $wlen);
>  last if $wlen != $rlen;
>  }
> 
>  return Apache::OK;
>  }
> 
>  1;
>  __END__
> 
>   Steve Lihn
>   FIS Database Support, Merck & Co., Inc.
>   Tel: (908) 423 - 4441
> 
> --
> Notice:  This e-mail message, together with any attachments, contains information of 
>Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, 
>proprietary copyrighted and/or legally privileged, and is intended solely for the use 
>of the individual or entity named in this message.  If you are not the intended 
>recipient, and have received this message in error, please immediately return this by 
>e-mail and then delete it.
> 
> ==



Re: Apache::OK error

2002-04-25 Thread Perrin Harkins

Lihn, Steve wrote:
> [Thu Apr 25 15:32:15 2002] [error] Bareword "Apache::OK" not allowed while
> "strict subs" in use at C:\Apache2/blib/lib/Apache2/Apache/Echo.pm line 25.
> Compilation failed in require at (eval 2) line 3.
> 
> What do I miss?

Try Apache::OK() instead.  Damn these faux constants!




Apache::OK error

2002-04-25 Thread Lihn, Steve

Hi,
I am testing the Apache::Echo connection handler for Apache2 and mod_perl 2.
But encounter the following error:

[Thu Apr 25 15:32:15 2002] [error] failed to resolve handler `Apache::Echo'
[Thu Apr 25 15:32:15 2002] [error] Bareword "Apache::OK" not allowed while
"strict subs" in use at C:\Apache2/blib/lib/Apache2/Apache/Echo.pm line 25.
Compilation failed in require at (eval 2) line 3.

What do I miss?

--Steve

--
package Apache::Echo;
 
 use strict;
 use Apache::Connection ();
 use APR::Socket ();
 
 use constant BUFF_LEN => 1024;
 
 sub handler {
 my Apache::Connection $c = shift;
 my APR::Socket $socket = $c->client_socket;
 
 my $buff;
 
 for (;;) {
 my($rlen, $wlen);
 my $rlen = BUFF_LEN;
 $socket->recv($buff, $rlen);
 last if $rlen <= 0;
 $wlen = $rlen;
 $socket->send($buff, $wlen);
 last if $wlen != $rlen;
 }
 
 return Apache::OK;
 }
 
 1;
 __END__
 
  Steve Lihn
  FIS Database Support, Merck & Co., Inc.
  Tel: (908) 423 - 4441





--
Notice:  This e-mail message, together with any attachments, contains information of 
Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, 
proprietary copyrighted and/or legally privileged, and is intended solely for the use 
of the individual or entity named in this message.  If you are not the intended 
recipient, and have received this message in error, please immediately return this by 
e-mail and then delete it.

==