I had problems with timeouts when I used "print $sock" instead of "$sock->send". some semi-down hosts made large delays more than 5 minutes. neither eval/alarm nor 'Timeout' socket parameter didn't work.
I never could think that there is a difference between print and send. send instead of print works fine. but in many places(FAQs, official perl docs, modules) people use and offer others to use print.