Perl already tells you where your problem is. In line 118.

You haven't shown us the values of $cds or $RC, and you don't show us the line 118 from your script.

From the error message Can't use string ("75") as a HASH ref and from the data you've showed, I can guess that your script tries to use the 75 from this hash entry:

'XM_010928396.1 ' => { 'ambigu' => 156, 'BC11_III_.RG' => 75, 'rc' => 195, 'BC11_II_.RG' => 120 },

Maybe you want to rerun your script using only this data, and then you should easily find out where your problem is.

Maybe you want to reduce your deep diving through the data structure into several steps, giving Perl the chance to be more to the point with its error messages:

# Convert this: values %{$hash_geno_group{$sample_geno_group}{$cds}{"rc"}} # to this: my $sample_geno_group_ref = $hash_geno_group{$sample_geno_group}; my $sample_cds = $sample_geno_group_ref->{$cds}; my $sample_rc = $sample_cds->{"rc"};

Maybe also output the Dumper of each step so you can see where you are within your data structure.


In reply to Re^3: Can't use string ("0") as a HASH ref while "strict refs" problem by Corion
in thread Can't use string ("0") as a HASH ref while "strict refs" problem by etricaen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.