User Tools

Site Tools


tutorials:perl:read_and_write.pl

This is an old revision of the document!


read_and_write.pl
# read_and_write.pl
# read from an input file 
# and write the content to an output file. 
# Assume the two filenames are provided in the command line. 
 
my $in_file = shift;
my $out_file = shift;
 
open IN, "<$in_file";
open OUT, ">$out_file";
while ( my $line = <IN> ) {
	print OUT "$line";
}
close OUT;
close IN;
tutorials/perl/read_and_write.pl.1339561240.txt.gz · Last modified: by chkuo