#!/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 fielnaem and strings my ($infile, $outfile, $string, $rstring) ; print "What file should I parse?\n" ; chomp($infile = ) ; print "What expression should I look for?\n" ; chomp($string = ) ; print "What should I replace that string with?\n" ; chomp($rstring = ) ; print "What new file should I create with your replacement string?\n" ; chomp($outfile = ) ; #Open the file, perform the substitutions, and create the new user named file. open (READFILE, "$infile") || die "Can not open your file for parsing: $!" ; open (WRITEFILE, ">$outfile") || die "Can not open new replacement file: $!" ; while (<$infile>) { print WRITEFILE "$_" ; }