I'm having problems in using a regexp and hashed hashes. I have the following variables:
$code = reference to an array holding identifiers $hashhash = reference to a hash
The hash has the following form:
$hashhash = { 'identifier' => {'score' => 7, 'query_start' => 80, 'query_end' => 1292, 'subj_start' => 367, 'subj_end' => 1563 'e_value' => '5e-12', 'defline' => 'description', 'taxon' => 'Homo sapiens', }, 'identifier' => {...} }
My buggy code looks like this:
if ($hashhash->{$codes->[$x]}->{'defline'} =~ m/NP_/) { do_something; }
$x is cycled from 0 to scalar(@{$code}); and I'm searching for 'NP_' in the defline. The code crashes with:
Can't use string ("description") as an ARRAY ref while "strict refs" in use at /home/spitzem/wp/retr_standaloneblast_ +ABCGfam.pl line 589 (#1) (F) Only hard references are allowed by "strict refs". Symbolic references are disallowed. See perlref.
I don't see any where I use the description-string as an ARRAY-reference. The problem is that some cycles work flawlessly, but then it crashes and I don't see any difference or reason what could explain this behaviour. Any hints are welcome, I'm just at the edge of knocking my head on the table... ;-)
Cheers, Micha
In reply to strict refs and REGEXP error by professa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |