in reply to strict refs and REGEXP error

I believe you might be victim to a misindentified line, or yourself misindentifying it. This code looks wrong to me:
elsif (($blast_par->{$cleancodes->[$y]}->{"defline"}->[$y] !~ m/NP_/) +&& ($blast_par->{$cleancodes->[$x]}->{"defline"}->[$x] =~ m/NP_/)) {
$blast_par->{$cleancodes->[$x]}->{"defline"} should point to "description", but you then add ->[$x] which attempts to dereference "description" as an array.

Replies are listed 'Best First'.
Re: Re: strict refs and REGEXP error
by professa (Beadle) on Apr 30, 2002 at 13:46 UTC
    Whoops!
    You're right, that '...->{"defline"}->[$y]' shouldn't be there, I didn't notice that. But I just wonder why Perl complains about a misused ARRAY-ref in the previous 'if'-statement and not in the faulty 'elsif'-line...?

    => I just tested the old subroutine with the buggy code and corrected it like you proposed and...it works.
    Very confusing that Perl reports an error a few lines up and not for the buggy line itself... ;-)
    Thanx for clarifying my daily Perl-nebulae a bit!! :-)

    Cheers, Micha