Question: Write a program in perl that prompts for an input filename, an output filename, a search pattern, and a replacement string, and replaces all occurrences
Write a program in perl that prompts for an input filename, an output filename, a search pattern, and a replacement string, and replaces all occurrences of the search pattern with the replacement string while copying the input file to the output file. Try it on some files. Can you overwrite an existing file (don't try it with anything important!)? Can you use regular expression characters in the search string? Can you use $1 in the replacement string?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
