I'd just add that, in either case, given that you are dealing with a GUI, it's usually a best practice to use a separate thread for the UI events processing and another for the processing:
- LWP::UserAgent::timeout() it's a lower bound: "The requests is aborted if no activity on the connection to the server is observed for "timeout" seconds.This means that the time it takes for the complete transaction and
the request() method to actually return might be longer."
- Depending on what you do when you # deal with $response there are good chances you'll end freezing again your UI