sub addTo() { my $location = $_[0]; my $data = $_[1]; my @keys = split(/\//, $location); my $key; my $current = $database; while($key = shift(@keys)) { $current->{$key} = {} unless (exists $current->{$key} && ref($current->{$key}) eq "HASH"); $current = $current->{$key}; } #I AM STUCK HERE ----- $current = $data; } #### my $pointer = \$database->{"2002"}->{"Gustav"}->{"General"}->{"Overview"}; ${$pointer} = "nasdfaull"; #### $current->{$key} = $data;