I need to store keys and values dynamically in hash of hash.I know i can't use %hash[$i]. So how to proceed. Any help will be appreciated :     use Data::Dumper;
    print "enter number of orders";
    $count=<STDIN>;
    my @arr;
    my @order;
    my @protocol;
    my @message_length;
    my @logon;
    my @value_send;
    my @value_receive;
    my @seq_number;
    my @time;
    my @retransmission;
    my @account;
    my @destination;
    my @qty_order;
    my @ticker;
    my @instruction;
    my @order;
    my @locate;
    
    for($i=1;$i<=$count;$i++){    
    
    print "enter the value of tag8";
    $protocol[$i]=<STDIN>;
    chomp($protocol[$i]);
    print "enter the value of tag9";
    $message_length[$i]=<STDIN>;
    chomp($message_length[$i]);
    print "enter the value of tag35";
    $logon[$i]=<STDIN>;
    chomp($logon[$i]);
    print "enter the value of tag49";
    $value_send[$i]=<STDIN>;
    chomp($value_send[$i]);
    print "enter the value of tag56";
    $value_recieve[$i]=<STDIN>;
    chomp($value_recieve[$i]);
    print "enter the value of tag34";
    $seq_number[$i]=<STDIN>;
    chomp($seq_number[$i]);
    print "enter the value of tag52";
    $time[$i]=<STDIN>;
    chomp($time[$i]);
    print "enter the value of tag43";
    $retransmission[$i]=<STDIN>;
    chomp($retransmission[$i]);
    print "enter the value of tag1";
    $account[$i]=<STDIN>;
    chomp($account[$i]);
    print "enter the value of tag100";
    $destination[$i]=<STDIN>;
    chomp($destination[$i]);
    print "enter the value of tag38";
    $qty_order[$i]=<STDIN>;
    chomp($qty_order[$i]);
    print "enter the value of tag55";
    $ticker[$i]=<STDIN>;
    chomp($ticker[$i]);
    print "enter the value of tag21";
    $instruction[$i]=<STDIN>;
    chomp($instruction[$i]);
    print "enter the value of tag54";
    $order[$i]=<STDIN>;
    chomp($order[$i]);
    print "enter the value of tag114";
    $locate[$i]=<STDIN>;
    chomp($locate[$i]);
    
   // I know the syntax is not correct of declaring hash. 
    my %userhash[$i] = (
    "8" => $protocol[$i],
    "9" => $message_length[$i],
    "35" => $logon[$i],
    "49" => $value_send[$i],
    "56" => $value_recieve[$i],
    "34" => $seq_number[$i],
    "52" => $time[$i],
    "43" => $retransmission[$i],
    "1" => $account[$i],
    "100" => $destination[$i],
    "38" => $qty_order[$i],
    "55" => $ticker[$i],
    "21" => $instruction[$i],
    "54" => $order[$i],
    "114" => $locate[$i],
    "59" => $duration[$i],
    "40" => $market[$i],
    "11" => $id[$i],
    "60" => $timeexecution[$i],
    "553" => $userid[$i],
    "10" => $checksum[$i],
    
       );
    $userhash[$i+1]{$orderno}={%userhash[$i]};
    
    print Dumper(\%userhash[$i]);
    
    }