Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

(joealba) Re: (tye)Re: Just making sure...

by joealba (Hermit)
on Nov 27, 2001 at 00:35 UTC ( [id://127618]=note: print w/replies, xml ) Need Help??


in reply to (tye)Re: Just making sure...
in thread Detect Stop Button

Yup. tye is right. I am wrong. S'ok. I've been wrong before. hehehe.

use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use sigtrap qw(handler croak normal-signals error-signals); $|=1; print &header; for (1..60) { # Comment the next line, and see the difference! print "$_<BR>\n"; sleep(1); }
Run this code and hit the STOP button while it's looping. You'll get $SIG{PIPE} and possibly $SIG{TERM} as well. Comment out the print line, and the script will run to completion -- because, although STDOUT is closed, the script isn't printing. So, it never fails on a write to STDOUT to cause the $SIG{PIPE}.

Thanks for setting me straight, tye.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://127618]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-03-28 10:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found