To open a file for reading and writing:
open(FH, "+<filename"); # Opens "filename" for read, then write. open(FH, "+>filename"); # Opens "filename" for write, then read.