#!/usr/bin/perl use strict; use warnings; open my $hairpin_file, '<', "test.hairpin", or die $!; my %HoA_sequences; while (my $line = <$hairpin_file>){ if ($line =~ /^>hsa/){ $HoA_sequences{$line} = ## Do I provide the key for the hash as soon as I read in the line bearing the sequence name? ## And can I create a hash with a key but no hash? I'm guessing not. :/ } }