Ah, my most favorite topic. Asynchronous programming. :)
Perl has an excellent solution:
POE.
It will have a learning curve, but it is well worth the time and effort. I am using
POE-Component-Client-HTTP myself, but you can give it a try with moritz's suggestion: LWP::UserAgent::POE