in reply to Hash & Array
Use a RE to determine whether you're dealing with PIZZA or SEAFOOD. Use unpack to generate a list of names. And populate the names into a hash of lists, where the hash keys are times of day, and the value of each key is an anonymous array filled with names.
The RE is probably unnecessary though if you just use a little logic to look at the first element of what unpack returns to set a sticky flag for PIZZA or SEAFOOD.
Update: Ultimately the structure might look something like this:
%hash = ( 'PIZZA' => { '10:00' => [ 'Dave', 'Dan'], '10:15' => [ 'Marge, 'Homer ] }, 'SEAFOOD'=>{ '10:00' => [ 'Pete', 'Jose' ], '10:30' => [ 'Kim', 'Aileen' ] } );
Dave
|
|---|