$ perl -wE '$_ = " - - "; s/^\s*\b(.*)\b\s*$/$1/g; say qq["$_"]' " - - " #### use v6; say ' - - '.trim.perl;