#!/usr/bin/perl -w
open (INFILE, "first.txt") or die "Input file: $!";
open (OUTF, ">second.txt") || die "Output file: $!";
while ( INFILE ) {
#Replace the "hi" with "Hello"
s/hi/Hello/g;
#print the input stream into the file "second.txt"
print OUTF $_;
}
Tuesday, October 14, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment