in reply to multi dimensional hash
You could add another level below variants
poj#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %hash; while (my $line = <DATA>){ my ($tag1, $tag2, $tag3) = split /\t/, $line; if ($tag2 =~/NN/) { ++$hash{$tag3}{frequency}; ++$hash{$tag3}{variants}{$tag1}; } } print Dumper \%hash;
|
|---|