in reply to hash reference

You need that to be initialized as a hash reference, else you are going to be doing unwanted symbolic referencing which you don't want. (Using strict.pm would have given you a more informative error message.)

A better way to do that initialization is:

$smbconf{$share} ||= {};
(I use ||= in case you want a given section to be able to be declared, redeclared, and added to.)