From: [EMAIL PROTECTED] > I have an unusual question: If I have an anonymous array stored in a > hash, is there a more graceful way of iterating through each item in > the anonymous array than using a counter? i.e., > > @all_records{q} = [1, 2, 3]
This should be $all_records{q} = [1, 2, 3] @hash{something} is a hash slice ... even though in your case the slice contains only one item ... it allows you to access several items at once: @h{a,b,c} = (1,2,3); print "A=$h{a}\n"; print "B=$h{b}\n"; print "C=$h{c}\n"; > $j = 0; > while ($all_records{q}->[$j]) { > print $all_records{$i}->[$j]; > $j++; > } foreach $item (@{$all_records{q}}) { print "$item\n"; } HTH, Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]