I am trying to build a data structure, and am tripping up here.  
any suggestions?
Thx!
Dave

!/usr/bin/perl -w
.... snip...
@bags = param('handbag');   get all of the bags styles
@bag_quantity = param('quantity');   get all of the bags quantity 

foreach my $bag (@bags){
($bag_name,$imgName)  =  split (/,/,$bag);
push %bags_ordered,$bag_name;
push %bags_ordered{$bag_name}{image_name} = $imgName;
}

foreach my $q (@bag_quantity){
push %bags_ordered{$bag_name}{$bag_quantity} =$q; 
}


Data structure: 



%bags_ordered = (
"bag-style1" =>   { price => 10,
                image_name => 'FIO-142b-small',
                 quantity=> 5
               },

"bag-style2" =>   { price => 12,
                image_name => 'GUC-208-small',
               quantity=> 5,
               },

);

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to