It is called "autovivification". Have a read through perlreftut and perlref.
You have seen it happen in a light weight way whenever you assign a value to an array element that hadn't been used before. It is a little more interesting in the case of a reference which you are using for the first time, but is one of the underpinnings of creating and managing "interesting" data structures in Perl, as indeed was the case here.
My pleasure, education is a large part of what PerlMonks is about.
DWIM is Perl's answer to Gödel