#!/usr/bin/perl -w use strict; #This program asks for an input file, output file, a string, # and a replacement string. It then searches the input file # for the string and substitutes it with a phrase of the # user's choice. #get user input... #there are many problems with this code... #Open the file, perform the substitutions, and create the # new user named file. open (READFILE, "$infile") || die "Can not open input file $infile: $!" ; open (WRITEFILE, ">$outfile") || die "Can not create outfile $outfile: $!; while (<$infile>) { ### PROBLEM ### ### Should use READFILE, the file handle ### ### instead of the string "$infile" ### ### while () ### print WRITEFILE "$_" ; }