mbayer has asked for the wisdom of the Perl Monks concerning the following question:
$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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: FILE READ and WRITE
by Roy Johnson (Monsignor) on Nov 22, 2005 at 20:27 UTC | |
by larryp (Deacon) on Nov 22, 2005 at 20:50 UTC | |
|
Re: FILE READ and WRITE
by jonadab (Parson) on Nov 22, 2005 at 20:28 UTC | |
by ikegami (Patriarch) on Nov 22, 2005 at 23:05 UTC | |
by mbayer (Novice) on Nov 22, 2005 at 20:42 UTC | |
|
Re: FILE READ and WRITE
by larryp (Deacon) on Nov 22, 2005 at 20:43 UTC | |
|
Re: FILE READ and WRITE
by aufflick (Deacon) on Nov 23, 2005 at 00:58 UTC |