#!/usr/bin/perl -w
use strict;

# load module (*.pm)
use GeneticCode;

while ( my $DNA = <> ) {
	chomp($DNA);

	my $protein = '';

	# start te beginning and move by three places through DNA
	for ( my $i = 0; $i <= (length($DNA) - 2); $i += 3 ) {
		# extract single codon starting at position $i
		my $codon = substr( $DNA, $i, 3 );
		# call subroutine from GeneticCode module
		$protein .= codon2aa( $codon );
	}

	print "$protein\n";
}

