my $fake_file; open(my $fh, ">", \$fake_file) or die $!; print $fh, "foo\n"; print $fh, "bar\n"; print $fake_file;