On 11-04-14 03:29 PM, mark baumeister wrote:
#create key - value pairs to go into a hash by first entering each
into a list @k or @v
print "input key/value pairs: first a key then return, then a value
then return, etc. To stop entering key/value pairs type 'stop'\n";
while ($kv =<STDIN>) {
    chomp($kv);
    push(@kv, $kv);
    last if ($kv == "stop");
}


Have you tried:

%hash = @kv;


--
Just my 0.00000002 million dollars worth,
  Shawn

Confusion is the first step of understanding.

Programming is as much about organization and communication
as it is about coding.

The secret to great software:  Fail early & often.

Eliminate software piracy:  use only FLOSS.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to