Re: What phase am I in?

2001-12-21 Thread Perrin Harkins

> I have the book but I don't always have it with
> me.

That chapter is actually available for free on-line at
http://www.modperl.com/.
- Perrin




Re: What phase am I in?

2001-12-21 Thread Thomas Eibner

On Sat, Dec 22, 2001 at 06:04:08AM +, Mark Fowler wrote:
> On Fri, 21 Dec 2001, Dave Rolsky wrote:
> 
> > Which is nice for ORA and the books authors, but fairly irritating for
> > folks like myself.  Hell, I have the book but I don't always have it with
> > me.
> 
> For what it's worth: 
> http://safari.oreilly.com/main.asp?srchtext=current_callback

I think his main problem was that he didn't know wheter there was such
a function or what it was called. There's a good chance Dave would be
able to figure out how to use it from reading the sources if he actually
knew what the function was called.

-- 
  Thomas Eibner  DnsZone 
  mod_pointer  



Re: What phase am I in?

2001-12-21 Thread Mark Fowler

On Fri, 21 Dec 2001, Dave Rolsky wrote:

> Which is nice for ORA and the books authors, but fairly irritating for
> folks like myself.  Hell, I have the book but I don't always have it with
> me.

For what it's worth: 
http://safari.oreilly.com/main.asp?srchtext=current_callback

I know it's no reason to not have good documentation, but having a copy of 
the eagle book to hand is very useful.  Does anyone know if ORA have any 
plans to release it on CD at any point?

The Perl CD Bookshelf is great - especially as I can carry it around with 
me on my laptop and not have to worry about connecting to the net to read 
it.

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}





Re: What phase am I in?

2001-12-21 Thread Dave Rolsky

On 21 Dec 2001, Vivek Khera wrote:

> > "DR" == Dave Rolsky <[EMAIL PROTECTED]> writes:
>
> >> It's called current_callback().
>
> DR> Grr, its not documented when I do 'perldoc Apache'.
>
> There's a lot of stuff not so documented.  The mod_perl book has much
> more complete docs.

Which is nice for ORA and the books authors, but fairly irritating for
folks like myself.  Hell, I have the book but I don't always have it with
me.

I'd submit patches for this but I'm figuring 1.2x will be out of date soon
enough with 2.0 in the works.  Hopefully that will be better documented
and if not, I can always help out.


-dave




RE: File handle, STDOUT, help

2001-12-21 Thread Tripp Donnelly

Although no one responded, I figured it out,
my $io = select();
will give me a handle to the default output file handle, which is all I
needed... everything works fine...

Just in case anyone cared

-Tripp

-Original Message-
From: Tripp Donnelly 
Sent: Thursday, December 20, 2001 12:12 PM
To: [EMAIL PROTECTED]
Subject: File handle, STDOUT, help


Please forgive me if this is in the documentation somewhere. I have been
unable to find it. Also, please note, although I am not a novice at
Perl, the more interesting uses of file handles, STDOUT, redirection and
such are over my head.

I'm having a problem with a mod_perl app I'm working on. The goal is to
have a mod_perl app that zips up a bunch of files, and sends it to you,
without creating any temporary files (The zips could get huge). I have
it working, but the way I'm doing it, the number of bytes downloaded is
not logged (well, it shows 5 bytes downloaded for a multi megabyte zip).
I understand this, because I'm writing directly to the socket. What I
don't understand is how to work around the problem...

Here's the important segment of my code (Much cut out):

sub handler {
my $r = shift;

my $c = $r->connection;
my $fd = $c->fileno();

my $io = new IO::Handle;

$io->fdopen ( $fd, "w" );
$io->autoflush(1);

$zip->writeToFileHandle($io, 0);
$io->close;



I'm using Archive::Zip to zip the files up. It requires a file handle to
write out to (or an actual file, but I don't want any temp files, I want
to create zips on the file, and send them directly to the end user).

The end goal: send the zip file, without using temp files, and log the
size downloaded through normal apache logging (I have custom logging
handler to log the info to a database, but the normal access log is
showing only 5 bytes downloaded too).

Thanks,

- Tripp Donnelly
- Systems Integrator
- BG Telecommunications
- www.BGTelecommunications.com
- [EMAIL PROTECTED]
- (314) 439-0100 ext 28



Re: What phase am I in?

2001-12-21 Thread Vivek Khera

> "DR" == Dave Rolsky <[EMAIL PROTECTED]> writes:

>> It's called current_callback().

DR> Grr, its not documented when I do 'perldoc Apache'.

There's a lot of stuff not so documented.  The mod_perl book has much
more complete docs.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/



Class::Singleton dies on "warn"?

2001-12-21 Thread wsheldah



Hi,

I just started experimenting with Class::Singleton to store some static config
information. I subclassed it, put a couple test variables in it, and loaded in
my HTML::Mason page. Everything seemed fine. Then I added a simple warn
statement to the _instance_new() method so I could verify exactly when it got
instantiated from scratch, and it basically got treated like a "die" statement,
spewing the standard Mason stack trace that Mason normally does on run-time
errors. Is this a bug or a feature? The solution seems to be to avoid warning
statements like the plague in any Singleton objects.

Versions:
Apache:   1.3.20
mod_perl  1.26
perl  5.6.1
HTML::Mason1.03
Class::Singleton1.03
OS:   Linux, kernel 2.2.19

Thanks,

Wes Sheldahl





Re: PerlWarn and syslog

2001-12-21 Thread Lance Uyehara

> On Thu, Dec 20, 2001 at 01:59:18PM -0500, Geoffrey Young wrote:
> >
> > > > If you just print to STDERR you might want to look at
Apage::LogSTDERR
> > > > on CPAN.
> > >
> > > I took at look on CPAN and was unable to find this module or any
reference
> > > to it. Any idea if it has been merged into some other module or if it
has
> > > just gone away?
> >
> > over the years, the folks at critical path keep teasing with talk of
> > releasing Apache::LogSTDERR, but I don't think anyone outside of CP
> > (Doug, Brian, Paul) has actually seen it :)
>
> My apologies.  I never realized that it had never been released.  I'm
> volunteering to maintain it, so I'll publish it under my CPAN id
> soon..
>
> For now you can visit:
>
>   http://www.modperlcookbook.org/code.html
>
> and pick up a copy.

Thanks for the info. I've taken the various suggestions and am going with
Errorlog "| /some/perl/script.pl". Thanks to all who responded.

I really appreciate the help.
-Lance






Re: PerlWarn and syslog

2001-12-21 Thread Paul Lindner

On Thu, Dec 20, 2001 at 01:59:18PM -0500, Geoffrey Young wrote:
> 
> > > If you just print to STDERR you might want to look at Apage::LogSTDERR
> > > on CPAN.
> > 
> > I took at look on CPAN and was unable to find this module or any reference
> > to it. Any idea if it has been merged into some other module or if it has
> > just gone away?
> 
> over the years, the folks at critical path keep teasing with talk of
> releasing Apache::LogSTDERR, but I don't think anyone outside of CP
> (Doug, Brian, Paul) has actually seen it :)

My apologies.  I never realized that it had never been released.  I'm
volunteering to maintain it, so I'll publish it under my CPAN id
soon..

For now you can visit:

  http://www.modperlcookbook.org/code.html 

and pick up a copy.

Enjoy!

-- 
Paul Lindner[EMAIL PROTECTED]   | | | | |  |  |  |   |   |

mod_perl Developer's Cookbook   http://www.modperlcookbook.org
 Human Rights Declaration   http://www.unhchr.ch/udhr/index.htm



Apache KeepAlive

2001-12-21 Thread Stathy Touloumis

It seems to stop occurring if I set MaxRequestPerChild to One as well.

Thanks,



Apache KeepAlive

2001-12-21 Thread Stathy Touloumis

Has anyone encountered issues when setting 'KeepAlive On' in there apache
conf?  After an initial request it seems that none of my handlers are called
and the apache handlers take control.  After a period of time the
appropriate handlers seem to operate.  If I reload quickly the same issue
occurs.

-Thanks




multipart read error

2001-12-21 Thread Boex,Matthew W.


i am getting this error message in my apache error_log when i try to upload
a file...  (i am using cgi.pm, rh7.1, apache 1.3.22, mod_perl/1.24_01, php
4.0.4pl1).

CGI.pm: Server closed socket during multipart read (client aborted?)

i do not abort the upload.  i get this error as soon as i hit my "upload"
button.  weird, i can upload smaller files no problem.  files that are
between 10-40k are no problem.  when i upload 100-400k, i get this error
immediately.  is this an apache configuration issue?

i apologize if this isn't the right venue for this question... 

matt





Re: File upload error

2001-12-21 Thread Igor Sysoev

On Fri, 21 Dec 2001, Alexei Danchenkov wrote:

> This might be a bit offtopic, but while uploading a file to a server,
> all zeros (0x0) are replaced with spaces (0x20). What is wrong with
> the following code then or what's wrong with the server configuration?
> I am using HTML::Mason with Apache server 1.3.22 under RedHat Linux 6.2
> When I am doing the same on the Win32 (local devel machine, no problem
> occurs).

I think you are using Russian Apache.

http://apache.lexa.ru/configure.html#charsetrecodemultipartforms

Igor Sysoev




File upload error

2001-12-21 Thread Alexei Danchenkov

Hello, All,
This might be a bit offtopic, but while uploading a file to a server,
all zeros (0x0) are replaced with spaces (0x20). What is wrong with
the following code then or what's wrong with the server configuration?
I am using HTML::Mason with Apache server 1.3.22 under RedHat Linux 6.2
When I am doing the same on the Win32 (local devel machine, no problem
occurs).

# UPLOADING IMAGE
if ( my $upload = $r->upload ) {
  $url = $upload->filename;
  $url =~ s/((?:[^\/\\]*?[\/\\]*?)*)([\w\s\.\[\]]*$)/$2/;
  my $fh = $upload->fh;
  my $buffer = "";
  my $fullpath = $ENV{"DOCUMENT_ROOT"}; # w/o trailing slash
  $fullpath =~ s/docs.*/images\//; # adding missing slash
  my $bytesread = 0;
  if ( sysopen OUTPUT, $fullpath . $url, O_CREAT | O_WRONLY | O_EXCL ) {
binmode $fh;
binmode OUTPUT;
while ( my $bytes = sysread( $fh, $buffer, 65536 ) ) {
  syswrite( OUTPUT, $buffer );
  $bytesread += $bytes;
}
close OUTPUT;
  } else { $m->out( "Couldn't open " . $fullpath . $url ); }
} # END UPLOADING

Alexei
mailto:[EMAIL PROTECTED]