Mega Code Archive

 
Categories / Perl / File
 

Open Operators

Operation              Syntax                               Description Read                   open(INFILE,"<filename");            Read from the file. Write                  open(OUTFILE, ">filename");          Destroy any existing file and write to a new file. Append                 open(APP, ">>filename");             Write to the end of an existing file. Read/write             open(RW, "+<filename");              Read and write from an existing file. Write to a program     open(PIPEOUT, "|filename");          Send data to a program or command. Also called opening a program pipe. Read from a program    open(PIPEIN"filename|");             Receive data from a program or command.