FWICT you have ample explanations of why the . operator throws a warning, but it looks like nobody* has given a proper explanation of why .= does not throw a warning. And the reason is simple, it is special cased not to. Most (but not all) of the mutator style operators of the form X= (where X could be any operator symbol) are special cased not to throw warnings when used on undef lvalues. Similar rules apply to ++ and --. This is because its generally agreed that its "ok" to do stuff like $hash{somekey}++ or $hash{somekey}.=$str when $hash{somekey} doesn't have a defined value.
* well, liverpole gives an explanation but its not clear to me if the documentation he is referencing explains what he thinks it does. (UPDATE, actually im pretty sure it doesnt. :-)
In reply to Re: problem unless I use ".="
by demerphq
in thread problem unless I use ".="
by cgmd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |