$output_file = "ConsumerMV.sh"; $input_file = "mikels.out"; $quit_code = "quit\n"; open(FILE, $input_file); #opens data.txt in read-mode open(FILE, ">$output_file"); #opens file to be written to while(<FILE>){ #reads line by line from chomp; print "Saw $_ in data.txt\n"; print FILEHANDLE $_; #print the output file con +tents } close $input_file; #close the file. #close $output_file; #close the file.
In reply to FILE READ and WRITE by mbayer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |