Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
e.g.
problem is I don't know what $foo and $bar are so I can't create the anonymous list before I get into the loop and if I did $somehash{$foo.$bar} = []; first then surely it would reset the list each time round the loop!?for (@somelist) { my($foo,$bar) = split; my $x = somecalc($foo,$bar); # this line won't work!! push @$somehash{$foo.$bar}, $x; }
please help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: push onto hash!
by lachoy (Parson) on Apr 03, 2001 at 20:07 UTC | |
|
Re: push onto hash!
by Tortue (Scribe) on Apr 03, 2001 at 20:17 UTC | |
|
Re: push onto hash!
by arturo (Vicar) on Apr 03, 2001 at 20:05 UTC | |
by Ovid (Cardinal) on Apr 03, 2001 at 20:32 UTC | |
|
(sacked: hash slice notation) Re: push onto hash!
by sacked (Hermit) on Apr 05, 2001 at 02:14 UTC |