while( ) { @tmp = split(/\*/); SWITCH: { for ($i = 0; $i <= $#tmp; $i++) { if ($tmp[$i]) { # make sure the first value is the key. print "Setting key : $KEY\n", if ($Verbose); $KEY = "$tmp[$i]"; # populate the key with the other values # hostname*rvd*daemonPort : 7500 for ($i; $i <= $#tmp; $i++) { # reached the last var populate the value if ( $tmp[$i] =~ /^(\w+)\s+\:\s+([A-Z.0-9_\/])/ig) { $Vars{$KEY}{$tmp[$i - 1]}{$1} => $2; print "$tmp[$i]"; }else{ $Vars{$KEY}{$tmp[$i]}; } } last SWITCH; } } } } # while