in reply to Why does perl get this right and C doesn't ?

I'm guessing it's something about buffering , but I'm not sure.
It isn't. Note that you're doing chomp($ans=<STDIN>); in your perl code, while you're not doing anything like that in the C code.
#include <stdio.h> int main() { char answer=' '; printf("(F)irst,(S)econd,(T)hird\n"); scanf("%c",&answer); while(answer !='F' && answer !='S' && answer !='T') { printf("answer was: '%c', which is not what I want\n",answer); printf("(F)irst,(S)econd,(T)hird\n"); scanf("%c",&answer); } return 0; }
Gives:
$ ./a.out (F)irst,(S)econd,(T)hird a answer was: 'a', which is not what I want (F)irst,(S)econd,(T)hird answer was: ' ', which is not what I want (F)irst,(S)econd,(T)hird