in reply to Re: processing key value pairs of a hash
in thread processing key value pairs of a hash

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %clone_hash; while (<DATA>) { chomp; my @fields = split /\t/; my ($gene_symbol, $esc_qc) = ($fields[0], $fields[1]); $clone_hash{$gene_symbol} = $esc_qc; my $grade = ($esc_qc =~ /^pass[1-3]$/) ? 'good' : 'bad'; $clone_hash{$key}{$grade}++; } print Dumper(\%clone_hash); _DATA_ 4933402D24Rik fail 4933402D24Rik fail 4933402D24Rik fail 4933402D24Rik fail 4933402D24Rik fail 4933402D24Rik fail 4933402D24Rik fail 4933402D24Rik pass1
When I run this I get an error message stating that a
bareword is found where an operator is expected near
"4933402D24Rik"(missing operator before "D24Rik"),
what does this mean?

Replies are listed 'Best First'.
Re^3: processing key value pairs of a hash
by lomSpace (Scribe) on Apr 15, 2009 at 16:20 UTC
    I realized that I did not use two underscores before and after DATA.