http://www.perlmonks.org?node_id=442688


in reply to again problem with regexpr

You want to load a file from your hard dick? :-|

What you want seems to be inplace editing:

#!/usr/bin/perl -i.bak while(<>) { s/trojan is like viruse/hello/g; print }
The -i switch makes your script to process the files you pass as arguments to the script inplace. The extra .bak makes it create a backup.

Alberto Simões