perl -nle"print /(DOG)/ ? $1 : 'Not found'" #### perl -ple"$_ = /(DOG)/ ? $1 : 'Not found'"