while (<>) { s/foo/bah/g; print $_ || "Nothing\n"; }