I would bet that your color.txt file has Windows line endings on all platforms. If you do this:
perl test.pl color.txt | less you may find that you're getting output after all. Make sure color.txt has Unix line endings on the Linux machines. Here's one way to fix it: perl -pi -e 'tr/\r//d' color.txt Ronald