dislimit has asked for the wisdom of the Perl Monks concerning the following question:
But it can't compile: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]; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Function composing a hash of arrays.
by liverpole (Monsignor) on Dec 26, 2006 at 13:56 UTC | |
|
Re: Function composing a hash of arrays.
by jonadab (Parson) on Dec 26, 2006 at 14:22 UTC | |
|
Re: Function composing a hash of arrays.
by wfsp (Abbot) on Dec 26, 2006 at 14:31 UTC | |
|
Re: Function composing a hash of arrays.
by jettero (Monsignor) on Dec 26, 2006 at 13:52 UTC |