Help for this page
sub test_and_write { my ($TWR, $condition) = @_; print $TWR "True\n" if $condition; }
open my $OUT, '>', 'output.txt' or die "Cannot open output.txt: $!"; test_and_write($OUT, int rand 2);