
spuds
Novice
Mar 20, 2011, 7:14 PM
Post #31 of 35
(8046 views)
|
Re: [spuds] Manipulating a Hash with keys that have more than one value
[In reply to]
|
Can't Post
|
|
Hi, Here is the test data and how I fill the HoA with the script that works. # test data my $ruleKey1 = "aRule-REQUEST"; my $contents1 = "# rulenumber=1"; my $ruleNum1 = 1; my $ruleKey2 = "bRule-REQUEST"; my $contents2 = "# rulenumber=11"; my $ruleNum2 = 11; my $ruleKey3 = "cRule-REQUEST"; my $contents3 = "# rulenumber=4"; my $ruleNum3 = 4; # add keys and their values to an anonymous array $rules{$ruleKey1} = [ $contents1, $ruleNum1 ]; $rules{$ruleKey2} = [ $contents2, $ruleNum2 ]; $rules{$ruleKey3} = [ $contents3, $ruleNum3 ]; Only difference in the one that throws the array ref "1" error is that the data there is retrieved from the local file system files, getting the $contents from one file at a time. Thank you. - spuds
|