Re: Handling the User pressed Stop button case - problems
[prev]
[thread]
[next]
[Date index for 2004/11/29]
Sorry, this is my source.
#!/usr/bin/perl
my $r=shift;
$r->send_http_header('text/plain');
print"PID=$$\n";
$r->rflush;
while(1)
{
$r->print("\0");
$r->rflush;
last if $r->connection->aborted;
$i++;
sleep 1;
}
ERROR: Can't call method "send_http_header" on an
undefined value at scan2.cgi line 3.
--- Michael Peters <mpeters@xxxxxxxxx.xxx> escribió:
>
> Federico M. wrote:
> > Hi, what's wrong whit this script.
> > I need to detect when the user press the stop
> button.
> > I read:
> >
> >
>
http://perl.apache.org/docs/1.0/guide/debug.html#Handling_the__User_pressed_Stop_button__case
> >
> >
> >
> > SO: Debian Sarge.
> >
> > This is my apache.http:
> > -----------------------
> >
> > # If the perl module is installed, this will be
> > enabled.
> > <IfModule mod_perl.c>
> > <IfModule mod_alias.c>
> > Alias /perl/ /var/www/perl/
> > </IfModule>
> > <Location /perl>
> > SetHandler perl-script
> > PerlHandler Apache::Registry
> > PerlFixupHandler Apache::SIG LogFormat "%h %l
> %u
> > %t \"%r\" %s %b &{SIGPIPE}e"
> > Options +ExecCGI
> > </Location>
> > </IfModule>
> >
> > I have mod_perl.so, but don't have mod_perl.c
> >
> > This is my script:
> > ------------------
> >
> > #!/usr/bin/perl
>
> you need to assign the request object to $r
>
> my $r = shift;
>
> > $r->send_http_header;
> > print"PID=$$\n";
> > $r->rflush;
> > while(1)
> > {
> > $r->print("\0");
> > $r->rflush;
> > last if $r->connection->aborted;
> > $i++;
> > sleep 1;
> > }
>
> If you had put a 'use strict' in there at the top it
> might have been
> easier to see this.
>
> --
> Michael Peters
> Developer
> Plus Three, LP
>
>
Correo Yahoo! - 6 MB, tecnología antispam ¡gratis!
Suscribite ya http://correo.yahoo.com.ar/
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html