use strict; use warnings; use 5.010; use English; { #Turn on inplace editing for <> operator, no backup file: local $INPLACE_EDIT = ""; local @ARGV = "./test/data.txt"; #...or list file name on command line while(my $line = <>) { $line =~ s/hello/goodbye/; #alter the line print $line; #...then print() it (*required*) } }