% perl -e 'open FOO, "| tee baz.txt"; print FOO "hiya\n"; close FOO' hiya % cat baz.txt hiya