abhay180 has asked for the wisdom of the Perl Monks concerning the following question:
############################################### For this i did the following:This is how the array should look like: $xentry[0] = {BUCK_0 => JUNK, BUCK_1 => JUNK, BUCK_2 => JUNK, BUCK_3 = +> JUNK} ; $xentry[1] = {BUCK_0 => JUNK, BUCK_1 => JUNK, BUCK_2 => JUNK, BUCK_3 = +> JUNK} ; So on....
Now if i try accessing "$xentry[0]->{BUCK_0}"...It doesnt seem to work. Can somebody let me know the right thing to do?$str=""; for(my $i=0; $j<100;$i+=1) { for(my $j=0; $j<4;$j+=1) { $str .= "BUCK"."_"."$j"." => "."JUNK".","; } #Removes the Comma at the end $str = substr($str,0,length($str)-1); #Appending flower braces. $str = "{".$str."}"; $xentry[$i] = $str; $str=""; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Array of Hashes
by moritz (Cardinal) on Jul 24, 2009 at 13:11 UTC | |
by abhay180 (Sexton) on Jul 24, 2009 at 13:14 UTC | |
by abhay180 (Sexton) on Jul 27, 2009 at 05:49 UTC | |
by mzedeler (Pilgrim) on Jul 24, 2009 at 18:41 UTC | |
|
Re: Perl Array of Hashes
by davido (Cardinal) on Jul 25, 2009 at 06:41 UTC | |
by abhay180 (Sexton) on Jul 27, 2009 at 06:02 UTC | |
|
Re: Perl Array of Hashes
by stevemayes (Scribe) on Jul 25, 2009 at 11:13 UTC | |
by abhay180 (Sexton) on Jul 27, 2009 at 05:55 UTC | |
by mzedeler (Pilgrim) on Jul 27, 2009 at 07:19 UTC | |
by abhay180 (Sexton) on Jul 27, 2009 at 13:16 UTC | |
by abhay180 (Sexton) on Jul 28, 2009 at 12:03 UTC |