--- Coro/Coro.pm 2007/10/06 00:39:07 1.149 +++ Coro/Coro.pm 2007/10/06 01:11:01 1.150 @@ -473,6 +473,22 @@ This method simply sets the C<< $coroutine->{desc} >> member to the given string. You can modify this member directly if you wish. +=item $coroutine->throw ([$scalar]) + +If C<$throw> is specified and defined, it will be thrown as an exception +inside the coroutine at the next convinient point in time (usually after +it gains control at the next schedule/transfer/cede). Otherwise clears the +exception object. + +The exception object will be thrown "as is" with the specified scalar in +C<$@>, i.e. if it is a string, no line number or newline will be appended +(unlike with C). + +This can be used as a softer means than C to ask a coroutine to +end itself, although there is no guarentee that the exception will lead to +termination, and if the exception isn't caught it might well end the whole +program. + =cut sub desc {