in reply to Editing Contents of a File

You don't appear to be writiing anything to the output file.
May I suggest the following
#!/usr/bin/perl -w use strict; open INPUT, 'your_input_fiel.txt'; open OUTPUT '>your_output_file.txt'; while (my $line = <INPUT>) { chomp $line; $line =~ s/hello/goodbye/gi' print <OUTPUT> $line; } close INPUT; close OUTPUT;
Hope this helps