$t^=1 changes the value of $t (and thus the return value) on each execution, 0 or 1 don't.
In reply to Re: grep function usage by moritz in thread grep function usage by rgadireddy