User Tools

Site Tools


tutorials:perl:read_and_write.pl
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.txt · Last modified: 2012/06/13 12:21 by chkuo