sub test_and_write { my ($TWR, $condition) = @_; print $TWR "True\n" if $condition; }