Following on from the third order quine challenge, your task is to write an Ouroboros program that uses as many languages as possible.
That is, in language A, write a program pA which outputs program pB in language B. Program pB should output program pC in language C, and so on until eventually a program outputs the original program pA in language A.
No two languages in your loop can be the same or subsets or supersets of each other. None of the programs in the loop may be identical.
The longest chain of languages win. The length of the source code will be the tie-breaker.
Here is an example solution of length 3 given by Ventero.
s='print q<puts %%q{s=%r;print s%%s}>';print s%s
with Python generates this Perl snippet
print q<puts %q{s='print q<puts %%q{s=%r;print s%%s}>';print s%s}>
which generates the following Ruby code
puts %q{s='print q<puts %%q{s=%r;print s%%s}>';print s%s}
which then prints the original Python snippet:
s='print q<puts %%q{s=%r;print s%%s}>';print s%s