Number the prisoners from 1, 2, ..., n (I'm going to do this more generally; in the case of this particular problem, take n = 100). For each prisoner k, where k is odd, define a function f_k that maps the ordered (n-1)-tuples of elements in {1, 2, ..., n}\{k} into {0,1}, where f_k maps an (n-1)-tuple to the parity of the number of times you would switch two coordinates in the given n-tuple in order to get (1, 2, ..., k-1, k+1, ..., n); this doesn't necessarily have to be the most efficient way of switching coordinates; you can switch them however you like. That this function is well-defined is a consequence of that the number of such necessary flips will always be even or odd (I have a goofy proof of this that basically implies that the determinant of the a certain (n-1)x(n-1) matrix would have to be both 1 and -1 if you could do both). For even k, define f_k essentially the same way, but return 1 minus the parity instead.
In accordance with the real numbers painted on the people's heads, define a permutation of {1, 2, ..., n} σ, where the number on σ(i)'s forehead (call this r(σ(i)) is less than that of σ(i+1)'s for 1<=i<n. Any prisoner σ(i) can see that r(σ(1)) < r(σ(2)) < ... < r(σ(i-1)) < r(σ(i+1)) < ... < r(σ(n)). Have him look at the image of (σ(1), σ(2), ..., σ(i-1), σ(i+1), ..., σ(n)) under f_σ(i). If it's zero, have him wear the white glove on his left hand; otherwise, have him wear it on his right.
Note that we want each prisoner in the line to have made the opposite decision of how to wear the gloves as the person to his right for each person other than the last, i.e. the number the prisoner σ(i) gets him from his function is different from the number σ(i+1) gets from his function for 1<=i<n.
In order to prove this works, consider f_σ(i)(σ(1), ..., σ(i-1), σ(i+1), σ(i+2), ..., σ(n)) and f_σ(i+1)(σ(1), ..., σ(i-1), σ(i), σ(i+2), ..., σ(n)). Suppose that it takes k switches of pairs of σ(1), ..., σ(i-1), σ(i+1), σ(i+2), ..., σ(n) to get 1, 2, ..., σ(i)-1, σ(i)+1, ..., n. Note that if we apply essentially the same switches to σ(1), ..., σ(i-1), σ(i), σ(i+2), ..., σ(n), but with σ(i) in the role of σ(i+1), we get 1, 2, ..., σ(i)-1, σ(i)+1, ..., n, but with σ(i) in the position that σ(i+1) would occupy. Now, number the positions of each of the prisoners in this list of n-1 people from least to greatest; say p1 is the spot that 1 is in, p2 is the spot that 2, is in, ...., p(σ(i)-1)=σ(i)-1, p(σ(i)+1)=σ(i), ..., σ(n)=n-1.
Suppose σ(i+1) > σ(i).
Suppose σ(i+1) and σ(i) are odd. Then σ(i) is an even-indexed position (this is because of the skip from σ(i)-1 to σ(i)+1), and σ(i)+1 is an odd position. If we want to move σ(i) to its proper location, we can translate it with its element to the left over and over again until we get it where we want it to be. This will take p(σ(i))-p(σ(i)+1)) translations, which is an odd number, so f_σ(i+1)(σ(1), ..., σ(i), σ(i+2), ..., σ(n)) is the parity of k plus an odd number, while f_σ(i)(σ(1), ..., σ(i-1), σ(i+1), ..., σ(n)) is the parity of k; these parities are different, so the prisoners will make the correct decisions.
Now suppose σ(i+1) and σ(i) are both even. Then σ(i) is in an odd position and σ(i)+1 is in an even position. By essentially the same logic as above, we see that the parities of the numbers of translations are different (note that in this case the functions return one minus the parity, but the prisoners still make opposite decisions).
Assume σ(i+1) is odd and σ(i) is even. Then σ(i) is in an even position and σ(i)+1 is in an even position. Then the number of translations to get the natural order from here is now even, so the numbers of parities of the two numbers of translations are now the same; however, since the even dude returns one minus the parity, his function returns a different output as the other guy. Yay.
Assume σ(i+1) is even and σ(i) is odd. Then σ(i) is an odd position, as is σ(i)+1. Then the number of translations from here to the usual position is even. Blah, blah, same as above.
The case where σ(i+1) < σ(i) is probably similar, but a little easier since you don't have that goofy skip from σ(i)-1 to σ(i)+1 doing weird things to the parity of the positions. I'm not going to write it out.
So, yeah. Adjacent prisoners make different decisions. Woohoo.