sub deref { my $aref = shift; $aref = $aref->[shift] while (@_ > 2); return $aref->[$_[0]] = $_[1]; }