in reply to Re^2: LWP::Useragent - why doesn't this code work? :/
in thread LWP::Useragent - why doesn't this code work? :/

...but if the value of $1 was wrong (overwritten) at ## 3 ##, why did it revert to the correct value (http:) in the subsequent debug print in your original code??   Sure, it's good practice to store away captures early, but not doing so is unlikely to have been the issue in this particular case.