my $memory_file; my $fh; open ($fh, '>', \$memory_file); print $fh "abc"; if( $memory_file =~ m/^.*$/ ) { print "yes\n" } else { print "no\n" }