or download this
The subroutine variant requires a reference to callback
routine as the second argument to the request method and
...
The request can be aborted by calling die() in the call-
back routine. The die message will be available as the
"X-Died" special response header field.