http://www.perlmonks.org?node_id=545673


in reply to Login and htaccess

The LWP::UserAgent module will follow up to 7 redirects (by default) and you could set it for Basic Authendication with $ua->credentials .