It's probably not a good idea to reinvent the wheel every time you need to program a trivially simple bioinformatics problem that thousands have wrestled with before you.
Download, install and use Bioperl instead.
Bioperl on CPAN.
Bioperl.org
--
Regards,
Helgi Briem
hbriem AT simnet DOT is