in reply to get value of hash hold by array and array hold by another hash
What they said.
But also, you're using commas in your C-style loop, where the correct delimiter is semi-colons. Without semi-colons, it's being interpreted as some non-C-ish for-loop, where you want to run three commands in sequence: $i, $i<@$val, and $i++, ( the first two presumably for side-effects) and use the value of the third.
I haven't used a C-ish loop in years ... not relevant in Perl. If you DO want to increment over the indices, the simplest way is using the range operator:
for my $index ( 0 .. @{$val} -1 ) { do_stuff() }
But mostly for loops are for iterating over arrays or lists, possibly the keys from hashes
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
|
|---|