Ferrers wrote a treatise on Spherical Harmonics published in 1877. For real x on [-1,1], so that x = cos(theta) for theta on [0, pi], he defined a function which I will write here as F(n,m,x)
F(n,m,x) = [sin(theta)]^m times(d^m/dx^m)[P(n,x)],
where P(n,x) is the ordinary Legendre polynomial of degree n.
Since this function uses the m'th derivative of P(n,x) Ferrers is also interested only in 0 <= m <= n, that is, only non-negative integer m values.
Most modern texts treat the associated Legendre function of the first kind, which I write here as P(n,m,x), starting from a definition that
P(n,m,x) = (-1)^m times F(n,m,x).
The factor (-1)^m is sometimes called the Condon-Shortley phase factor, after the authors of an influential treatise in physics.
If one is working in classical potential theory and needs only real-valued functions on the sphere (such as in the classic works in Geodesy and Geomagnetism) one often finds a surface spherical harmonic defined as a real
function F(n,m,cos(theta)) {sin or cosine}(m phi), where phi is the longitude.
(Some sort of normalization factor N(n,m) is also included, but which one varies, unfortunately, as in Schmidt normalization in geomagnetism and other normalizations in Geodesy).
Some more modern (and some would say more "natural" or "pure") books define a surface harmonic using the factor (-1)^m and also making the spherical harmonics complex by writing
Y(theta, phi) = N(n,m) (-1)^m F(n,m,cos(theta)) exp(i m phi), where i is the imaginary unit, n >= 0, and -n <= m <= n. (e.g. Jackson's treatise on Classical Electrodynamics).
In general, for complex nu, mu, z, P(nu,mu,z) behaves better as z approaches x in [-1,1] than F(n,m,z). (Hence the phrase "on the cut", treating a portion of the real line as a cut of the complex plane.)
Even if one is only working with non-negative integer n,m and real x in [-1,1], as in classical potential theory for a real-valued function on a sphere, it can still be useful to include the factor (-1)^m and work with P and not F.
If the Legendre polynomial P(n,x) is defined by Rodriguez' formula then P(n,m,x) can be defined in terms of the (n+m)'th derivative of (x^2-1)^n, in which case the definition works for negative m as well, and the function is non-zero for -n <= m <= n, so the natural basis for the Y(theta, phi) form of a surface spherical harmonic.
Also, the factor (-1)^m may help to stabilize certain recurrence formulae if these are used in numerical computation.
Unfortunately some authors include (-1)^m in the definition of P and some do not, so you need to be careful. Also, they use the term "normalized" in different ways: the squared 2-norm of the surface spherical harmonic may be 1 or (4 pi) or may include a factor of 1/(2n+1). [Be careful also about the normalization when m=0, because the integral over (2pi) of cos(m phi) or sin(m phi) is pi for m not equal zero but is (2pi) for cos and zero for sin when m=0.]
And in addition to understanding what the author is trying to do, one may also need to understand whether including or not the factor (-1)^m makes the recursion more or less stable. E.g. Matlab's function legendre(n,x) does a backward recurrence from m=n to m=0 at fixed n using the factor (-1)^m in the formula. (Unfortunately their documentation merely cites a chapter in Abramowitz & Stegun. I believe what they are really doing is implementing a recursion that Backus, Parker and Constable say is stable for backward m if n is not much more than 100.) So even if you need to implement Ferrer's function in order to replicate what someone has done in a book, you might be better off computing it as P and then converting P to F via (-1)^m.
Caveat emptor.
I hope this helps. I have only a little background on this issue and am familiar with only the simple case where x is real and on [-1,1] for positive integer n,m. And a tiny acquaintance with Q(n,m,z) for imaginary z when n,m = 2,0 which arises in the standard ellipsoidal model for the Earth's gravity field.
Reference for the m recurrence is George Backus, Robert Parker, and Catherine Constable: Foundations of Geomagnetism (Cambridge, 1996), which does a beautiful job of developing the spherical harmonics from the point of view of homogeneous harmonic polynomials and normed linear vector spaces. References for the fact that Ferrer's definition lacks the (-1)^m can be found in Sansone's treatise on orthogonal functions and in Hobson's treatise on Spherical and Ellipsoidal Harmonics.