use APR; open(FH, '>test.txt') or die "Cannot open test.txt: $!\n"; print FH "This is some text\n"; close(FH);