Tanalis has asked for the wisdom of the Perl Monks concerning the following question:
Bit of a stupid question, probably, but it's driving me mad .. I have a hash of data which I'm trying to assign to an array using
push @RefHash, \%content;
Now, I've checked that I have clean data up to that point, and that %content is getting populated correctly, and it is.
It seems that the push simply isn't working - anyone have any ideas why this might be the case?
The assignment code etc. is below:
my @selector = ("field1", "field2", "field3", "field4"); open IN, $FILE; my @RefHash; while (<IN>) { chomp; my @inLine = split; my %content; @content{@selector} = @inLine; push @RefHash, \%content; }
Like I say, it's probably something stupid, but I can't see it ..
Thanks in advance
--Foxcub
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Assignment of Arrays of Hashes
by broquaint (Abbot) on Oct 14, 2002 at 09:48 UTC | |
|
Re: Assignment of Arrays of Hashes
by Aristotle (Chancellor) on Oct 14, 2002 at 11:41 UTC | |
|
Re: Assignment of Arrays of Hashes
by physgreg (Scribe) on Oct 14, 2002 at 09:55 UTC | |
|
Re: Assignment of Arrays of Hashes
by Tanalis (Curate) on Oct 14, 2002 at 09:59 UTC | |
|
Re: Assignment of Arrays of Hashes
by blm (Hermit) on Oct 14, 2002 at 09:46 UTC | |
by Aristotle (Chancellor) on Oct 14, 2002 at 11:38 UTC |