I am using lwp::useragent object i am assiging timeout using
$ua =new LWP::UserAgent;
$ua->timeout(1);
this is not effected

if url is bad still it wait for long what to do to solve this problem?

Thanks for view it.