In your example, did you call credentials() also?
In reply to Re^4: LWP and Digest Authentication by BrowserUk in thread LWP and Digest Authentication by BrowserUk