in reply to Labels, while loops and FastCGI

An appropriate idiom for this kind of thing is to use die with a special token:

use constant END_REQUEST => "END_REQUEST\n"; sub end_request { die END_REQUEST } REQUEST: while(accept()) { eval { # process request 1; } or do { next REQUEST if $@ eq END_REQUEST; die $@; # propagate real errors }; }