LINE: while (defined($_ = )) { undef; } continue { die "-p destination: $!\n" unless print $_; } #### perl -i -pe's/foo/bar/g; s/y/yah/g;' filename