Sample Exercises

Command Line: Edit In Place

Return to exercise list

Write a command-line program that modifies the contents of the file(s) given on the command line, replacing the word "Java" with "Perl" wherever it occurs, case-insentively. In other words, delete any It should create a file called foo.txt.old for any file foo.txt given, containing the original contents; the file foo.txt should contain the modified version. (Yes, you can do this only with Perl command-line options!)

Solution for Edit In Place

Solution