in reply to help understanding code snippet

But that makes no sense as the hash is empty??

Its called autovivification, it means if you use it like an array ref it magically becomes an arrayref

use Data::Dump::Streamer; my %Hash; Dump(\%Hash); $Hash{'Empty'}[0] = 'no longer'; Dump(\%Hash); __END__ $HASH1 = {}; $HASH1 = { Empty => [ 'no longer' ] };
See autovivification, autovivification