This method may not suit you, since it does not capture the initial string, but it evades the string evaluation technicalities:
This inserts a comma at the first word-nonword boundary in the string$ perl -le '$_=q(ab cdefg);s/(?<=\w)\b/,/;print;'
After Compline,
Zaxo
In reply to Re: Interpolating $1 within a variable
by Zaxo
in thread Interpolating $1 within a variable
by s0ttle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |