Enable strict checks and warnings. Load a module that automatically handles I/O errors. Open file handle IN1 for reading from "file1". Open file handle OUT for writing to "result". While reading a line from IN1 does not indicate end-of-file: Write the line just read to OUT. If the line just read contains "architecture": Open file handle IN2 for reading from "file2". While reading a line from IN2 does not indicate end-of-file: Write the line just read to OUT. Close file handle IN2. Close file handle OUT. Close file handle IN1.