in reply to Creating hash with variables

vonedaddy,
First can you show some sample data please.
thanks
John

Replies are listed 'Best First'.
Re^2: Creating hash with variables
by colwellj (Monk) on Feb 11, 2010 at 04:19 UTC
    This works.
    #!/usr/bin/perl -w use strict; my (%ipkey,$value,$key); my $count = 0; my @rawdata = ('key1','value1','key2','value2','key3','value3'); foreach (@rawdata) { if ($count == 0) { $key = $_; $count++; next; }else{ $value = $_; $ipkey{$key} = $value; $count = 0; } }<\code> <br> OUTPUT<code> DB<4> x %ipkey 0 'key2' 1 'value2' 2 'key1' 3 'value1' 4 'key3' 5 'value3'