#!usr/bin/env perl open ( # open a filehandle test, # called 'test' "@ARGV" # pointing to file specified in arguments ); while ( # Loop # read line from filehandle "test" and assign to $_ ) { $_ =~ ; # chomp; # remove newline from end of $_ s/(th)/TH/gi; # Case insensitive replace 'th' with TH everywhere print "$_\n"; # print $_ with a new line }