etricaen has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks i have a "Can't use string ("0") as a HASH ref while "strict refs" in use at test_fontion4.pl line 117." this line is the "foreach my $RC(values %{$hash_geno_group{$sample_geno_group}{$cds}{"rc"}})" line , $RC has to be a number this is a art of my code :
#creation de la matrice des genotype selon les groupes genotypique foreach my $sample_geno_group(keys(%hash_geno_group)) { print $sample_geno_group. "\n"; foreach my $cds (keys %{$hash_geno_group{$sample_geno_group}}) { print "cds ".$cds. "\n"; next if ($cds eq "sample"); foreach my $RC(values %{$hash_geno_group{$sample_geno_group}{$ +cds}{"rc"}}) { print "rc ".$RC. "\n"; #verification du nombre minimun de reads pour chaque group +e genotypique if ($RC < $seuil_min_classe) { foreach my $ech_name(values @{$hash_geno_group{$sample +_geno_group}{"sample"}}) { $hash_sample_cds_genotype{$cds}{$ech_name} = "NA\t +" ; } delete($hash_geno_group{$sample_geno_group}); } else { foreach my $AB(values%{$hash_geno_group{$sample_geno_g +roup}{$cds}{"ambigu"}}) { #verification du pourcentage maximun de reads ambi +gu pour chaque groupe genotypique if (($AB *100 / $RC) > $seuil_max_amb) { foreach my $ech_name(values @{$hash_geno_group +{$sample_geno_group}{"sample"}}) { $hash_sample_cds_genotype{$cds}{$ech_name} + = "NA\t" ; } delete($hash_geno_group{$sample_geno_group}); } } } }
how can i fix thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't use string ("0") as a HASH ref while "strict refs" problem
by Corion (Patriarch) on Apr 12, 2016 at 09:43 UTC | |
by etricaen (Novice) on Apr 12, 2016 at 09:54 UTC | |
by Corion (Patriarch) on Apr 12, 2016 at 10:02 UTC | |
by etricaen (Novice) on Apr 12, 2016 at 11:21 UTC |