… | |
… | |
188 | |
188 | |
189 | my $hello_world = $coro->join; |
189 | my $hello_world = $coro->join; |
190 | |
190 | |
191 | print $hello_world; |
191 | print $hello_world; |
192 | |
192 | |
193 | Another way to terminate is to call C<< Coro::terminate >>, which works at |
193 | Another way to terminate is to call C<< Coro::terminate >>, the |
194 | any subroutine call nesting level: |
194 | thread-equivalent of C<exit>, which works at any subroutine call nesting |
|
|
195 | level: |
195 | |
196 | |
196 | async { |
197 | async { |
197 | Coro::terminate "return value 1", "return value 2"; |
198 | Coro::terminate "return value 1", "return value 2"; |
198 | }; |
199 | }; |
199 | |
200 | |