in reply to How to avoid "301 moved parmanently " from HTTPS responce?
Did you check $mech->redirect_ok()?