The minimum the regex can match is a $ because the second capture is optional. If there are no \w characters following a $ character then the second capture will be undef and you get the warning. There are two ways you can fix it depending on the desired result. Using
(\$(\w+))
prints '$Word $' for the sample line, and
(\$(\w*))
prints '$Word dollar'.
In reply to Re: Use of uninitialized value in concatenation
by GrandFather
in thread Use of uninitialized value in concatenation
by gem555
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |