Bruised Australia build vital lead in Perth