use strict; # Hash of arrays. my %distri; my @probExpr=qw(c_K n_cK); foreach (@probExpr) { print "$_\n"; #%distri{$_}=(); %distri{$_}=[]; } &hashOfArraysRef(\$distri{$probExpr[0]}); print "\$distri{$probExpr[0]}[5]\t"; print "$distri{$probExpr[0]}[5]\n"; #&aOa; 1; sub hashOfArraysRef #(\@) { my $arrayRef=$_[0]; # Dereference the passed-in reference to an array. @$arrayRef=(0..9); #@$arrayRef=[0..9]; }