$ perl -wE '$_ = "foo"; s/(foo)/bar \1/; say' \1 better written as $1 at -e line 1. bar foo