I need to be able to interrupt a pending HTTP::Request without terminating the process. Thanks to some suggestions from Chatterbox, I now have a snippet of code that works.
$ua->add_handler("response_data", sub {croak() if someCondition(); return 1}); my $resp = $ua->get($url);
In my case someCondition() tests a variable that's set in my INT handler so that it aborts the download if the user presses ^C.
In reply to Interrupting HTTP::Request by tdlewis77
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |