#!/usr/bin/perl usr strict; use warnings; my %hash; print "put ID followed by a comma with the DNA for that ID\n\n"; chomp(my $in = ); while($in){ # Split the input on a comma into a maximum of two fields my($id,$dna) = split m/,/, $in, 2; $hash{$id} = $dna; print "Please enter another ID and DNA\n"; chomp($in = ); } # Print hash contents while(my($key,$value) = each %hash){ print "$key -> $value\n"; }