open (FILE,"<$filename") or die "Cannot open: $!"; map{s/stuff/other_stuff/g;print}(); #### open (FILE,"<$filename") or die "Cannot open: $!"; @ary = map{s/stuff/other_stuff/g}(); #### perl -pe 's/stuff/other_stuff/g' filename.txt