in reply to fixed the problem
in thread fun(?) with +=

Update: This is redundant; davorg already said it above!

Since what you wanted to do is a common need, future versions of perl are supposed to include a "defined-or" operator:

$x //= 1; # same as $x = $x // 1;

will be equivalent to

$x = defined $x ? $x : 1; # same as $x = 1 unless defined $x