deadsea - 11:23 am on Nov 29, 2012 (gmt 0)
It needs to be like this. Single new lines between headers, double newline after the last one.
print "Content-type: text/html\n";
print "Vary: User-Agent\n\n";
The double new line needs to be after the last header. I believe that you are varying the pages based on the user agent for your mobile site, not based on accept-encoding, so your vary header should be "User-Agent".