My Question: If I'm given C:\text_file.txt as a parameter on the command line when my PERL script is called and the text_file.txt contains the text "Hello World World World", how do I replace all instances of "World" with "Earth"?
I'm new to PERL. I'm writing a script which accepts a parameter of a filepath. I want to do a find replace on the contents of the file. I know I could do something like this: $string =~ s/World/Earth/g; but I don't want to read the file into a string if I can help it. Is there a way to do this directly on the file without reading it in as a string? Thanks!