if($tmp[0] eq ">") { my $nm = substr($line,1); $nm = $nm . $tot; $tot++; $line = <$IFH>; #IS THIS THE LINE YOU MEANT ? chomp $line; $ret{$nm} = $line; }