#!/usr/bin/perl -w use strict; open my $FH, "<", "./sample.txt"; my %count = (); while ( my $genome = <$FH> ) { .... }