(2013•延庆县一模)若复数z=(m2-m-2)+(m+1)i(为虚数单位)为纯虚数,其中m∈R,则m=______.