I can shave a couple of strokes off of that:
perl -lpe'$_=/DOG/?$&:"Not found"'In reply to Re^3: Replacing a search/not found pattern with a word
by jwkrahn
in thread Replacing a search/not found pattern with a word
by pinpe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |