#!/usr/bin/perl use strict; use warnings; use Data::Dumper; #+~~~~~~~ Referenz { my %vars; my $mode = 1; my $curr_grad =\$vars{'gradient'}{$mode}; #...tu was... $vars{'gradient'}{1} = [[1,1,1],[1,2,3]]; print $$curr_grad->[1][1]++,"\n"; print $vars{'gradient'}{$mode}[1][1],"\n"; } #+~~~~~~~ Array { my %vars; my $mode = 1; $vars{'gradient'}{1} = [[],[]]; my @curr_grad = @{$vars{'gradient'}{$mode}}; #...tu was... (@{$vars{'gradient'}{1}[0]}[0..2],@{$vars{'gradient'}{1}[1]}[0..2]) = ((1,1,1),(1,2,3)); print $curr_grad[1][1]++,"\n"; print $vars{'gradient'}{$mode}[1][1],"\n"; }