foo does nothing. There is no parameter. So undef is returned. So no wonder nothing is printed.
The loop is run once. So a defined value is returned.
1 is different from 43 (or 42 or 2 or whatever other number you can come up besides 0) because it's usually used to represent "true".