I am trying to have a look at the elements of arrays in a dynamically created HoHoA. When I try something like this:
I get the following output:my ($span, %matches) = @_; my ($site, $fastaseq, $fasta, $sitekey) = ''; my ($setscounter,$lowerlimit,$upperlimit,$i,$set,$yes,$low,$hit) = 0; my %sets = (); FASTA: for $fastaseq (keys %matches) { $sitekey = ''; SITEKEY: for $sitekey (sort {$a <=> $b } keys %{$matches{$fasta +seq}}) { if (@{$matches{$fastaseq}{$sitekey}}) { SET: foreach $hit (@{$matches{$fastaseq}{$sitekey}}) { print "\$matches{$fastaseq}{$sitekey} is: $matches{$fastas +eq}{$sitekey}\n"; print "\$hit is: ",$hit,"\n"; print "\$hit is: ",$matches{$fastaseq}{$sitekey}[$hit],"\n +"; if ($hit >= $lowerlimit && $hit <= $upperlimit) { #some co +de }}}}}
BTW - line 386 is the first print $hit line, and so on. I'm using use strict and use warnings, and I am scratching my head like mad to try to figure out what's wrong. I've been staring at this so long, I am losing my train of thought anymore.$matches{>LG_XIV}{0} is: ARRAY(0x182bb14) Use of uninitialized value in print at MyScript line 386. $hit is: $hit is: 6906413 Use of uninitialized value in numeric ge (>=) at MyScript line 388.
If I replace the straight $hit calls in the greater than comparison with $matches{$fastaseq}{$sitekey}[$hit], I get no change.
Basically, I just want to know what each of the values in the array <code>$matches{$fastaseq}{$sitekey} array is, and then throw it into the comparison on that if (>= && <=) line. But, no dice.
Does anyone have any ideas, or can point out what I'm doing wrong?
Thanks,
Matt
In reply to foreach in HoHoA problems by mdunnbass
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |