http://www.perlmonks.org?node_id=920844

rolandomantilla has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to write a program that uses a loop to prompt a user to input a key/value pair to then store it in a hash until the user put if exit but i'm kinda lost. This is what I have until now I'm not getting any problems but after the first id/dna it stops
#!/usr/bin/perl %hash={ }; print ("put ID fallowed by a comma"," with the DNA for that ID\n\n"); $id=<STDIN>; chomp $id; @DNA=$id; foreach( $id){ %hash= (@DNA); if ($id){ print "Please enter another ID and DNA"} else {print "Exit";} exit;} print %hash;