sujeet97 has asked for the wisdom of the Perl Monks concerning the following question:
I am facing some trouble accessing values from a hash of arrays. I am attaching a sample code (this is not part of the main code but it pretty much shows the problem)
#!/usr/bin/perl %sampleHash = (); @array1 = ('a','b','c'); @array2=("x","y","z","s"); $sampleHash{"hash1"} = @array1; $sampleHash{"hash2"} = @array2; print $sampleHash{"hash1"}[0];
In the above code, the print statement is blank. I want it to show the value - a. Please help. Its urgent.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Trouble accessing Hash of Arrays
by Athanasius (Archbishop) on Apr 02, 2013 at 02:42 UTC | |
by sujeet97 (Initiate) on Apr 02, 2013 at 02:49 UTC | |
Re: Trouble accessing Hash of Arrays (troubleshooting basics)
by Anonymous Monk on Apr 02, 2013 at 02:36 UTC | |
Re: Trouble accessing Hash of Arrays
by AnomalousMonk (Archbishop) on Apr 02, 2013 at 22:51 UTC | |
Re: Trouble accessing Hash of Arrays
by vinoth.ree (Monsignor) on Apr 02, 2013 at 04:17 UTC |
Back to
Seekers of Perl Wisdom