open (IN, 'origdata.csv'); # Open the file for read open (OUT,'>','copy.csv'); # Open the file for write. Will overwrite if exists while() { # read contents of input file # , typucally used inside a while will populate variable $_ # more proecessing print OUT ($_); # Write out to new file }