perlquestion
Anonymous Monk
<p> Dear All,</p>
<p> I was using code that I found on PerlMonks page but can't seem to figure out how to use it. I have a set of hash reference created with;</p>
<code>
$idx = 0;
foreach $n (@IDs) {
push @{$An{$n}->{b}} , $bb[$idx];
push @{$An{$n}->{c}} , $cc[$idx];
push @{$An{$n}->{e}} , $ee[$idx];
push @{$An{$n}->{d}} , $dd[$idx];
push @{$An{$n}->{f}} , $ff[$idx];
$idx++;
}
</code>
<p> How can I then for each $ID print values of corresponging position? Such as $ID[0], @{$An{$n}->{b}}[0]? etc. Btw is it a better practice to declare arguments with 'my' at the begining or just in code? I end up with a code ehader having declaration of 40+ variables (not always possible to do subs). Thanks for help.</p>
6