- or download this
my %value = (
G => 0,
...
T => 2,
C => 3,
);
- or download this
$number = $w[$n]*(4**$n) + $w[$n-1]*(4**($n-1)) + ... + $w[0]
- or download this
sub word_to_number {
my (@w) = @_;
...
$res += $value{ pop @w };
};
};
- or download this
open my $frequencies, ">+", 'frequencies.bin'
or die "$!";
...
seek $requencies, $offset * 4;
write $frequencies, pack "N", $count;
};