system qw(perl -pib -e s/CAT/mouse/g D:\tmp\file.txt); # Or in case you need to replace an arg with a variable, then start with: system "perl", "-pib", "-e", "s/CAT/mouse/g", 'D:\tmp\file.txt';