in reply to grep function usage

Note that the block that's passed to grep is executed for every list element.

$t^=1 changes the value of $t (and thus the return value) on each execution, 0 or 1 don't.