open(ONE, "firstfile") or die("$!\n"); open(TWO, ">secondfile") or die("$!\n"); print TWO while ; close(ONE); close(TWO);